Proposal: Add IsList instance for ZipList

Henning Thielemann lemming at henning-thielemann.de
Thu Jun 11 09:26:02 UTC 2015


On Wed, 10 Jun 2015, David Feuer wrote:

> foo = getZipList $ [f,g,h] <$> [a,b,c] <*> [d,e,i]
>
> looks a lot better than
>
> bar = getZipList $ ZipList [f,g,h] <$> ZipList [a,b,c] <*> ZipList [d,e,i]

But the second one is less surprising.

For my taste it would have been better to give the ZipList semantics to 
the list type by default, because there are more data types that we can 
give a ZipList-like Applicative instance. The current non-determinism 
implementation for Applicative [] and Monad [] could have been used for a 
special non-determinism list type. But this instance was defined when 
there was no Applicative. :-(


More information about the Libraries mailing list