Why do we need Control.Monad.Instances?

Hello, I forgot the reason why we need Control.Monad.Instances which exports orphaned Functor and Monad instances for ((->) r), ((,) a) and (Either e): https://github.com/ghc/packages-base/blob/master/Control/Monad/Instances.hs Can't we just de-orphan these instances by moving the instances for ((->) r) and ((,) a) to GHC.Base and by moving the instances for Either to Data.Either? Regards, Bas

On Fri, 11 Nov 2011, Bas van Dijk wrote:
I forgot the reason why we need Control.Monad.Instances which exports orphaned Functor and Monad instances for ((->) r), ((,) a) and (Either e):
https://github.com/ghc/packages-base/blob/master/Control/Monad/Instances.hs
Compatibility with Haskell 98's Prelude?

This is one of those warts that should be cleaned up by either doing what was done with Num, breaking with 98/2011 or fixing it in Haskell 2012 and waiting a year.
The reason they are orphans is to avoid breaking existing code that may habe defined them itself and which was written to Haskell 98, but C.M.I has been around long enough that experienced users know to grab them there, and so the main impact of hiding them in C.M.I from a "POSIWYD" perspective is to confuse newbies.
The potential impact of just doing this right is less than the impact of changing Num, so I'd say we should just do it, and make C.M.I an empty stub.
I'll draft a proposal when I get to a computer.
-Edward
Sent from my iPhone
On Nov 11, 2011, at 9:09 AM, Henning Thielemann
On Fri, 11 Nov 2011, Bas van Dijk wrote:
I forgot the reason why we need Control.Monad.Instances which exports orphaned Functor and Monad instances for ((->) r), ((,) a) and (Either e):
https://github.com/ghc/packages-base/blob/master/Control/Monad/Instances.hs
Compatibility with Haskell 98's Prelude?
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Bas van Dijk wrote:
I forgot the reason why we need Control.Monad.Instances which exports orphaned Functor and Monad instances for ((->) r), ((,) a) and (Either e)
Henning Thielemann wrote:
Compatibility with Haskell 98's Prelude?
I seem to recall that at the time there was also concern about causing GHC error messages to become hairy. Just to clarify, I am not voting against taking these instances out of quarantine now. I'm fine either way. Thanks, Yitz
participants (4)
-
Bas van Dijk
-
Edward Kmett
-
Henning Thielemann
-
Yitzchak Gale