We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Bind m
bindWriterT
1 parent 6b552de commit 1ac2e73Copy full SHA for 1ac2e73
src/Control/Monad/Writer/Trans.purs
@@ -67,12 +67,12 @@ instance plusWriterT :: Plus m => Plus (WriterT w m) where
67
68
instance alternativeWriterT :: (Monoid w, Alternative m) => Alternative (WriterT w m)
69
70
-instance bindWriterT :: (Semigroup w, Monad m) => Bind (WriterT w m) where
+instance bindWriterT :: (Semigroup w, Bind m) => Bind (WriterT w m) where
71
bind (WriterT m) k = WriterT $
72
m >>= \(Tuple a w) ->
73
- case k a of WriterT wt ->
74
- wt >>= \(Tuple b w') ->
75
- pure $ Tuple b (w <> w')
+ case k a of
+ WriterT wt ->
+ map (\(Tuple b w') -> Tuple b (w <> w')) wt
76
77
instance monadWriterT :: (Monoid w, Monad m) => Monad (WriterT w m)
78
0 commit comments