Skip to content

Commit 30421c2

Browse files
committed
Restore apply/bind symmetry for MaybeT
1 parent 7bd268c commit 30421c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Control/Monad/Maybe/Trans.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ derive instance newtypeMaybeT :: Newtype (MaybeT m a) _
4444
instance functorMaybeT :: Functor m => Functor (MaybeT m) where
4545
map f (MaybeT ma) = MaybeT (map f <$> ma)
4646

47-
instance applyMaybeT :: Apply m => Apply (MaybeT m) where
48-
apply (MaybeT f) (MaybeT x) = MaybeT (apply <$> f <*> x)
47+
instance applyMaybeT :: Monad m => Apply (MaybeT m) where
48+
apply = ap
4949

50-
instance applicativeMaybeT :: Applicative m => Applicative (MaybeT m) where
50+
instance applicativeMaybeT :: Monad m => Applicative (MaybeT m) where
5151
pure = MaybeT <<< pure <<< Just
5252

5353
instance bindMaybeT :: Monad m => Bind (MaybeT m) where

0 commit comments

Comments
 (0)