Skip to content

Commit e09ecc5

Browse files
committed
Add MonadEff ExceptT instance
1 parent 477fe02 commit e09ecc5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Control/Monad/Except/Trans.purs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Prelude
66
import Control.Alt (Alt)
77
import Control.Alternative (Alternative)
88
import Control.Monad.Rec.Class (MonadRec, tailRecM)
9+
import Control.Monad.Eff.Class (MonadEff, liftEff)
910
import Control.Monad.Trans
1011
import Control.MonadPlus (MonadPlus)
1112
import Control.Plus (Plus)
@@ -82,6 +83,9 @@ instance monadTransExceptT :: MonadTrans (ExceptT e) where
8283
a <- m
8384
return $ Right a
8485

86+
instance monadEffExceptT :: (Monad m, MonadEff eff m) => MonadEff eff (ExceptT e m) where
87+
liftEff = lift <<< liftEff
88+
8589
-- | Throw an exception in an `ExceptT` computation.
8690
throwE :: forall e m a. (Applicative m) => e -> ExceptT e m a
8791
throwE = ExceptT <<< pure <<< Left

0 commit comments

Comments
 (0)