Proposal: Add missing Foldable/Traversable instances for Prelude types

Henning Thielemann lemming at
Sat Jan 22 21:02:52 CET 2011

On Sat, 22 Jan 2011, kahl at wrote:

> On Sat, Jan 22, 2011 at 05:12:00PM +0100, Bas van Dijk wrote:
>> Just for reference, the Functor instance on pairs is strict in the pair:
>> instance Functor ((,) a) where
>>         fmap f (x,y) = (x, f y)
> And this is necessary for the functor laws, because with
>  fmap' f ~(x,y) = (x, f y)
> we obtain:
>  fmap' id undefined = (undefined, undefined) /= undefined = id undefined

Thank you lot! I already wondered for similar data structures how to 
define fmap the correct way.

But then I see, that transformers:WriterT.Lazy matches lazily, too:

More information about the Libraries mailing list