I personally strongly believe in keeping the Applicative and Monad for a type compatible.

Otherwise why the heck did we make Applicative a superclass of Monad?

In this case the thing David wants only makes any difference if you explicitly turn on OverloadedLists, so if you never use that extension you'll never care about the instance anyways.

-Edward

On Thu, Jun 11, 2015 at 11:26 AM, Henning Thielemann <lemming@henning-thielemann.de> wrote:

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. :-(

_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries