Skip to content

Commit 7bd268c

Browse files
committed
Make ExceptT's apply/applicative consistent with bind
1 parent 08b975a commit 7bd268c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Control/Monad/Except/Trans.purs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,10 @@ derive instance newtypeExceptT :: Newtype (ExceptT e m a) _
5757
instance functorExceptT :: Functor m => Functor (ExceptT e m) where
5858
map f = mapExceptT (map (map f))
5959

60-
instance applyExceptT :: Apply m => Apply (ExceptT e m) where
61-
apply (ExceptT f) (ExceptT x) =
62-
let f' = apply <$> f
63-
x' = f' <*> x
64-
in ExceptT x'
60+
instance applyExceptT :: Monad m => Apply (ExceptT e m) where
61+
apply = ap
6562

66-
instance applicativeExceptT :: Applicative m => Applicative (ExceptT e m) where
63+
instance applicativeExceptT :: Monad m => Applicative (ExceptT e m) where
6764
pure = ExceptT <<< pure <<< Right
6865

6966
instance bindExceptT :: Monad m => Bind (ExceptT e m) where

0 commit comments

Comments
 (0)