File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module Control.Monad.RWS.Trans
88
99import Prelude
1010
11+ import Control.Alt (class Alt , (<|>))
1112import Control.Monad.Eff.Class (class MonadEff , liftEff )
1213import Control.Monad.Error.Class (class MonadError , throwError , catchError )
1314import Control.Monad.Reader.Class (class MonadAsk , class MonadReader )
@@ -58,6 +59,9 @@ instance applyRWST :: (Bind m, Monoid w) => Apply (RWST r w s m) where
5859 m r s' <#> \(RWSResult s'' a'' w'') ->
5960 RWSResult s'' (f' a'') (w' <> w'')
6061
62+ instance altRWST :: Alt m => Alt (RWST r w s m ) where
63+ alt (RWST m) (RWST n) = RWST $ \ r s -> m r s <|> n r s
64+
6165instance bindRWST :: (Bind m , Monoid w ) => Bind (RWST r w s m ) where
6266 bind (RWST m) f = RWST \r s ->
6367 m r s >>= \(RWSResult s' a w) ->
You can’t perform that action at this time.
0 commit comments