Skip to content

Commit 1ac2e73

Browse files
committed
Relax constraint to Bind m for bindWriterT
1 parent 6b552de commit 1ac2e73

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Control/Monad/Writer/Trans.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ instance plusWriterT :: Plus m => Plus (WriterT w m) where
6767

6868
instance alternativeWriterT :: (Monoid w, Alternative m) => Alternative (WriterT w m)
6969

70-
instance bindWriterT :: (Semigroup w, Monad m) => Bind (WriterT w m) where
70+
instance bindWriterT :: (Semigroup w, Bind m) => Bind (WriterT w m) where
7171
bind (WriterT m) k = WriterT $
7272
m >>= \(Tuple a w) ->
73-
case k a of WriterT wt ->
74-
wt >>= \(Tuple b w') ->
75-
pure $ Tuple b (w <> w')
73+
case k a of
74+
WriterT wt ->
75+
map (\(Tuple b w') -> Tuple b (w <> w')) wt
7676

7777
instance monadWriterT :: (Monoid w, Monad m) => Monad (WriterT w m)
7878

0 commit comments

Comments
 (0)