[Haskell-cafe] Functor instance derived from Monad

Brandon Allbery allbery.b at gmail.com
Wed Feb 19 21:38:17 UTC 2014

On Wed, Feb 19, 2014 at 5:25 PM, Frantisek Farka <frantisek at farka.eu> wrote:

> when reading the Functor-Applicative-Monad proposal [1] on Haskell
> wiki I remembered that I have seen instance similar to
>     instance (Monad m) => Functor m where
>         fmap f a = a >>= \x -> return $ f x
> with FlexibleInstances and UndecidableInstances language extensions.
> But I cannot remember where it was nor can I find any useful reference.
> Is there some library in Hackage with this and similar instances?

There is not, because the need for UndecidableInstances there is warning
you that this is perilous.

I thought some of the discussion behind the AMP touched on why this was not
considered as a solution?

brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140219/fdc84873/attachment.html>

More information about the Haskell-Cafe mailing list