Proposal: Foldable typeclass: make foldl' and foldr' class methods

Edward Kmett ekmett at
Mon Jun 20 20:13:22 CEST 2011

The minor breakage consideration is for folks who imported Data.Foldable
(Foldable(..)) now they'll get an extra couple of methods, but that is a
pretty fragile way to do imports anyways, and I think the benefits far
outweigh the costs.


On Mon, Jun 20, 2011 at 2:08 PM, Paterson, Ross <R.Paterson at>wrote:

> It's a pity to have to add methods to get around GHC's limitations,
> but it seems harmless.  Looks like you'll want strict versions of all
> 5 methods, though.
> > The only potential breakage is that foldl' and foldr' are exported via
> > Foldable(..) rather than directly. This could affect modules that use
> > explicit imports.
> I don't think so.  You can import methods separately.
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list