proposed change to transformers package

Nicolas Pouillard nicolas.pouillard at gmail.com
Mon Mar 29 05:42:57 EDT 2010


On Fri, 26 Mar 2010 19:28:18 +0000, Ross Paterson <ross at soi.city.ac.uk> wrote:
> On Fri, Mar 26, 2010 at 05:24:18AM -0700, Nicolas Pouillard wrote:
> > Could we have functors products, sums, fixpoints as well? It would really
> > avoid to redefine them each time.
> 
> Do you mean
> 
>   data Product f g a = Product (f a) (g a)

Yes, I was thinking of using :*: instead of Product:

data (:*:) f g a = (:*:) (f a) (g a)

> with Functor, Foldable, Traversable and Applicative instances?

Yes.

> Not sure if the other two count as transformers.

Why not:

data (:+:) f g a = Inl (f a) | Inr (g a)

  And sure, no applicative nor monad instance for this one.

And Fix like in category-extras:
http://hackage.haskell.org/packages/archive/category-extras/0.53.5/doc/html/Control-Functor-Fix.html

Best regards,

-- 
Nicolas Pouillard
http://nicolaspouillard.fr


More information about the Libraries mailing list