Proposal: Move the instances from Control.Monad.Instances into GHC.Base

Bas van Dijk v.dijk.bas at gmail.com
Sun Nov 13 13:58:10 CET 2011


On 13 November 2011 12:21, Yitzchak Gale <gale at sefer.org> wrote:
> If there is anywhere else in the base libraries where
> Control.Monad.Instances is imported, presumably
> that import should also be removed. Are we 100%
> certain that no other such import exists?

A quick grep shows that Control.Monad.Fix also imports
Control.Monad.Instances because it defines:

class (Monad m) => MonadFix m where ...

instance MonadFix ((->) r) where ...
instance MonadFix (Either e) where ...

Of course the import can be removed safely.

Speaking about MonadFix: What about adding this instance to Control.Monad.Fix:

instance Monoid w => MonadFix ((,) w) where
    mfix f = let m = f (snd m) in m

?

Bas



More information about the Libraries mailing list