Permalink
Browse files

Swap parameters of the MonadBase class (again)

  • Loading branch information...
1 parent 6de6eae commit 39fa9810cb2a37f645482b155fc1067846cc42de @basvandijk basvandijk committed Nov 10, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Control/Monad/Base.hs
@@ -31,7 +31,7 @@ import Text.ParserCombinators.ReadP ( ReadP )
import Text.ParserCombinators.ReadPrec ( ReadPrec )
import Control.Arrow ( ArrowApply, ArrowMonad )
-class (Monad m, Monad b) MonadBase m b | m b where
+class (Monad b, Monad m) MonadBase b m | m b where
-- | Lift a computation from the base monad
liftBase b α m α
@@ -55,11 +55,11 @@ BASE(, Identity)
-- | Can be used as a default implementation for 'liftBase'.
--
-- Note that: @liftBaseDefault = 'lift' . 'liftBase'@
-liftBaseDefault (MonadTrans t, MonadBase m b) b α t m α
+liftBaseDefault (MonadTrans t, MonadBase b m) b α t m α
liftBaseDefault = lift . liftBase
#define TRANS(T) \
-instance (MonadBase m b) ⇒ MonadBase (T m) b where liftBase = liftBaseDefault
+instance (MonadBase b m) ⇒ MonadBase b (T m) where liftBase = liftBaseDefault
TRANS(IdentityT)
TRANS(MaybeT)
@@ -71,7 +71,7 @@ TRANS(ContT r)
#undef TRANS
#define TRANS_CTX(CTX, T) \
-instance (CTX, MonadBase m b) ⇒ MonadBase (T m) b where liftBase = liftBaseDefault
+instance (CTX, MonadBase b m) ⇒ MonadBase b (T m) where liftBase = liftBaseDefault
TRANS_CTX(Monoid w, L.WriterT w)
TRANS_CTX(Monoid w, S.WriterT w)

0 comments on commit 39fa981

Please sign in to comment.