proposed change to transformers package

Mario Blažević mblazevic at stilo.com
Mon Mar 29 09:15:09 EDT 2010


Ross Paterson 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)
> 
> with Functor, Foldable, Traversable and Applicative instances?
> Not sure if the other two count as transformers.

I'd expect the appropriate functor product rather be something like

    data NestedProduct f g a = NestedProduct (f (g a))

IMO, all these functor combinators should be provided somewhere for the 
sake of standardization, and the transfomers package is not a bad place 
for them. They are quite useful for building new tranformers, even if 
they're not transformers themselves.



More information about the Libraries mailing list