[Haskell-cafe] A Proposed Law for Foldable?

David Feuer david.feuer at gmail.com
Fri Feb 13 02:29:52 UTC 2015


Someone must not have noticed the bit where I mentioned that proposing
Functor f => Foldable f in order to avoid the GADT stuff would make
everyone reject the idea. But to the extent that Gershom's law is a
good idea (I'm very far from convinced, because no one's explained in
a way that I can understand what makes it useful), it could by made a
conditional law: only Functor instances would have to obey it, in much
the same way that (of course) only Functor instances must obey foldMap
f = fold . fmap f.

On Thu, Feb 12, 2015 at 7:19 PM, Tom Ellis
<tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> On Thu, Feb 12, 2015 at 04:39:02PM -0500, Edward Kmett wrote:
>> And as been worked through to death in the past, Functor cannot be a
>> superclass of Foldable. ;)
>
> Because, for example, that wouldn't allow a Set to be Foldable.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries


More information about the Haskell-Cafe mailing list