From 1bb6f74645e39bb45e33a7413771ea7f971628c9 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 27 May 2023 12:10:51 +0200 Subject: Structural improvements --- src/Data/JLD/Control/Monad/RES.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Data/JLD/Control/Monad') diff --git a/src/Data/JLD/Control/Monad/RES.hs b/src/Data/JLD/Control/Monad/RES.hs index 1c96d46..b9f8f22 100644 --- a/src/Data/JLD/Control/Monad/RES.hs +++ b/src/Data/JLD/Control/Monad/RES.hs @@ -2,6 +2,7 @@ module Data.JLD.Control.Monad.RES ( REST, runREST, evalREST, + execREST, withEnvRES, withErrorRES, withErrorRES', @@ -20,6 +21,9 @@ runREST env st = flip runReaderT env .> runExceptT .> flip runStateT st evalREST :: Monad m => r -> s -> REST r e s m a -> m (Either e a) evalREST env st = flip runReaderT env .> runExceptT .> flip evalStateT st +execREST :: Monad m => r -> s -> REST r e s m a -> m s +execREST env st = flip runReaderT env .> runExceptT .> flip execStateT st + withEnvRES :: (r -> r') -> REST r' e s m a -> REST r e s m a withEnvRES fn (ReaderT m) = ReaderT <| fn .> m -- cgit v1.2.3-70-g09d2