File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
docs/Control/Monad/Writer Expand file tree Collapse file tree 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.
1919##### Instances
2020``` purescript
2121instance 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)
2323instance 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)
2626instance 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)
2828instance monadWriterT :: (Monoid w, Monad m) => Monad (WriterT w m)
2929instance monadRecWriterT :: (Monoid w, MonadRec m) => MonadRec (WriterT w m)
3030instance 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)
4848instance functorWriterT :: (Functor m ) => Functor (WriterT w m ) where
4949 map f = mapWriterT $ (<$>) \(Tuple a w) -> Tuple (f a) w
5050
51- instance applyWriterT :: (Monoid w , Apply m ) => Apply (WriterT w m ) where
51+ instance applyWriterT :: (Semigroup w , Apply m ) => Apply (WriterT w m ) where
5252 apply f v = WriterT $
5353 let k (Tuple a w) (Tuple b w') = Tuple (a b) (w <> w')
5454 in k <$> (runWriterT f) <*> (runWriterT v)
5555
5656instance applicativeWriterT :: (Monoid w , Applicative m ) => Applicative (WriterT w m ) where
5757 pure a = WriterT $ pure $ Tuple a mempty
5858
59- instance altWriterT :: (Monoid w , Alt m ) => Alt (WriterT w m ) where
59+ instance altWriterT :: (Alt m ) => Alt (WriterT w m ) where
6060 alt m n = WriterT $ runWriterT m <|> runWriterT n
6161
62- instance plusWriterT :: (Monoid w , Plus m ) => Plus (WriterT w m ) where
62+ instance plusWriterT :: (Plus m ) => Plus (WriterT w m ) where
6363 empty = WriterT empty
6464
6565instance alternativeWriterT :: (Monoid w , Alternative m ) => Alternative (WriterT w m )
6666
67- instance bindWriterT :: (Monoid w , Monad m ) => Bind (WriterT w m ) where
67+ instance bindWriterT :: (Semigroup w , Monad m ) => Bind (WriterT w m ) where
6868 bind m k = WriterT $ do
6969 Tuple a w <- runWriterT m
7070 Tuple b w' <- runWriterT (k a)
You can’t perform that action at this time.
0 commit comments