
29 Mar
2010
29 Mar
'10
9:15 a.m.
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.