+1 for adding a Contrafunctor/ContraFunctor to base somewhere. But I agree completely with Tony, please call it contramap. ;) Otherwise people will wonder why comonads are not cofunctors -- a matter which can be cleared up by avoiding sloppy terminology.
On 24 December 2010 02:16, Mario Blažević <mblazevic@stilo.com> wrote:Hi Mario
> To turn the proof obligation around, what could possibly be the downside of
> adding a puny Cofunctor class to the base library?
For the record I'm personally neutral on Cofunctor and on balance
would like to see Comonad added to Base.
My reservation is really at the "meta-level" - I suspect there are a
lot of candidates for adding to Base if you want to Base to be
systematic about "modeling structures". At the moment and possibly by
accident rather than explicit intention, the structures in Base
(Monoid, Applicative, Monad, Arrow) add good sets of operational
combinators as well as modeling structures (in Monoid's case it only
adds one operational combinator but it is the basis for Foldable, the
Writer Monad and more).
For Comonad, Cofunctor (Bifunctor, Semigroup...) not having the
visibility of being in Base certainly means there is less motivation
to discover valuable operations that use them, but should they go into
Base without an initial strong operational value, instead maybe
something between Base and Hackage is needed?
Certainly, Hackage isn't great for developing "Base candidates". The
bike shedding on the Libraries list, whilst frustrating for a
proposer, is valuable for teasing out more regular designs than single
authored packages often manage, and having lots of small packages for
Base-like things is a dependency burden that hinders adoption.
Best wishes
Stephen
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe