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
8
8
9
9
import Prelude
10
10
11
+ import Control.Alt (class Alt , (<|>))
11
12
import Control.Monad.Eff.Class (class MonadEff , liftEff )
12
13
import Control.Monad.Error.Class (class MonadError , throwError , catchError )
13
14
import 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
58
59
m r s' <#> \(RWSResult s'' a'' w'') ->
59
60
RWSResult s'' (f' a'') (w' <> w'')
60
61
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
+
61
65
instance bindRWST :: (Bind m , Monoid w ) => Bind (RWST r w s m ) where
62
66
bind (RWST m) f = RWST \r s ->
63
67
m r s >>= \(RWSResult s' a w) ->
You can’t perform that action at this time.
0 commit comments