Functor instance derived from Monad

Hi cafe, 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? Can you point out some leading marks to me? Thanks FF [1] http://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal

On Wed, Feb 19, 2014 at 5:25 PM, Frantisek Farka
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@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Wed, 19 Feb 2014 16:38:17 -0500
Brandon Allbery
On Wed, Feb 19, 2014 at 5:25 PM, Frantisek Farka
wrote: There is not, because the need for UndecidableInstances there is warning you that this is perilous.
Yes, I am aware of that. It's not the case I want to use this actual code. I am rather interested in its impact on typeclass hierarchy compared to AMP and Default Superclass instances
I thought some of the discussion behind the AMP touched on why this was not considered as a solution?
Could you elaborate on that? Although I gave it fair amount of googling I did not find out anything. Was it on some mailing list? Thanks a lot Cheers FF

On Wed, Feb 19, 2014 at 7:29 PM, Frantisek Farka
On Wed, 19 Feb 2014 16:38:17 -0500 Brandon Allbery
wrote: I thought some of the discussion behind the AMP touched on why this was not considered as a solution?
Could you elaborate on that? Although I gave it fair amount of googling I did not find out anything. Was it on some mailing list?
I thought it was on here, but it may have been libraries@haskell.org or one of the other lists. I can try to dig in my archives. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery
-
Frantisek Farka