File tree 2 files changed +8
-8
lines changed
docs/Control/Monad/Writer 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ The `MonadWriter` type class describes the operations supported by this monad.
19
19
##### Instances
20
20
``` purescript
21
21
instance functorWriterT :: (Functor m) => Functor (WriterT w m)
22
- instance applyWriterT :: (Monoid w, Apply m) => Apply (WriterT w m)
22
+ instance applyWriterT :: (Semigroup w, Apply m) => Apply (WriterT w m)
23
23
instance applicativeWriterT :: (Monoid w, Applicative m) => Applicative (WriterT w m)
24
- instance altWriterT :: (Monoid w, Alt m) => Alt (WriterT w m)
25
- instance plusWriterT :: (Monoid w, Plus m) => Plus (WriterT w m)
24
+ instance altWriterT :: (Alt m) => Alt (WriterT w m)
25
+ instance plusWriterT :: (Plus m) => Plus (WriterT w m)
26
26
instance alternativeWriterT :: (Monoid w, Alternative m) => Alternative (WriterT w m)
27
- instance bindWriterT :: (Monoid w, Monad m) => Bind (WriterT w m)
27
+ instance bindWriterT :: (Semigroup w, Monad m) => Bind (WriterT w m)
28
28
instance monadWriterT :: (Monoid w, Monad m) => Monad (WriterT w m)
29
29
instance monadRecWriterT :: (Monoid w, MonadRec m) => MonadRec (WriterT w m)
30
30
instance monadPlusWriterT :: (Monoid w, MonadPlus m) => MonadPlus (WriterT w m)
Original file line number Diff line number Diff line change @@ -48,23 +48,23 @@ mapWriterT f m = WriterT $ f (runWriterT m)
48
48
instance functorWriterT :: (Functor m ) => Functor (WriterT w m ) where
49
49
map f = mapWriterT $ (<$>) \(Tuple a w) -> Tuple (f a) w
50
50
51
- instance applyWriterT :: (Monoid w , Apply m ) => Apply (WriterT w m ) where
51
+ instance applyWriterT :: (Semigroup w , Apply m ) => Apply (WriterT w m ) where
52
52
apply f v = WriterT $
53
53
let k (Tuple a w) (Tuple b w') = Tuple (a b) (w <> w')
54
54
in k <$> (runWriterT f) <*> (runWriterT v)
55
55
56
56
instance applicativeWriterT :: (Monoid w , Applicative m ) => Applicative (WriterT w m ) where
57
57
pure a = WriterT $ pure $ Tuple a mempty
58
58
59
- instance altWriterT :: (Monoid w , Alt m ) => Alt (WriterT w m ) where
59
+ instance altWriterT :: (Alt m ) => Alt (WriterT w m ) where
60
60
alt m n = WriterT $ runWriterT m <|> runWriterT n
61
61
62
- instance plusWriterT :: (Monoid w , Plus m ) => Plus (WriterT w m ) where
62
+ instance plusWriterT :: (Plus m ) => Plus (WriterT w m ) where
63
63
empty = WriterT empty
64
64
65
65
instance alternativeWriterT :: (Monoid w , Alternative m ) => Alternative (WriterT w m )
66
66
67
- instance bindWriterT :: (Monoid w , Monad m ) => Bind (WriterT w m ) where
67
+ instance bindWriterT :: (Semigroup w , Monad m ) => Bind (WriterT w m ) where
68
68
bind m k = WriterT $ do
69
69
Tuple a w <- runWriterT m
70
70
Tuple b w' <- runWriterT (k a)
You can’t perform that action at this time.
0 commit comments