diff options
author | Volpeon <github@volpeon.ink> | 2023-05-27 12:10:51 +0200 |
---|---|---|
committer | Volpeon <github@volpeon.ink> | 2023-05-27 12:10:51 +0200 |
commit | 1bb6f74645e39bb45e33a7413771ea7f971628c9 (patch) | |
tree | 7b8c2866ff9198264a99f4da60d9fe82a3bf21fb /src/Data/JLD/Control | |
parent | Meta: Link to about page instead of raw readme (diff) | |
download | hs-jsonld-1bb6f74645e39bb45e33a7413771ea7f971628c9.tar.gz hs-jsonld-1bb6f74645e39bb45e33a7413771ea7f971628c9.tar.bz2 hs-jsonld-1bb6f74645e39bb45e33a7413771ea7f971628c9.zip |
Structural improvements
Diffstat (limited to 'src/Data/JLD/Control')
-rw-r--r-- | src/Data/JLD/Control/Monad/RES.hs | 4 |
1 files changed, 4 insertions, 0 deletions
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 ( | |||
2 | REST, | 2 | REST, |
3 | runREST, | 3 | runREST, |
4 | evalREST, | 4 | evalREST, |
5 | execREST, | ||
5 | withEnvRES, | 6 | withEnvRES, |
6 | withErrorRES, | 7 | withErrorRES, |
7 | withErrorRES', | 8 | withErrorRES', |
@@ -20,6 +21,9 @@ runREST env st = flip runReaderT env .> runExceptT .> flip runStateT st | |||
20 | evalREST :: Monad m => r -> s -> REST r e s m a -> m (Either e a) | 21 | evalREST :: Monad m => r -> s -> REST r e s m a -> m (Either e a) |
21 | evalREST env st = flip runReaderT env .> runExceptT .> flip evalStateT st | 22 | evalREST env st = flip runReaderT env .> runExceptT .> flip evalStateT st |
22 | 23 | ||
24 | execREST :: Monad m => r -> s -> REST r e s m a -> m s | ||
25 | execREST env st = flip runReaderT env .> runExceptT .> flip execStateT st | ||
26 | |||
23 | withEnvRES :: (r -> r') -> REST r' e s m a -> REST r e s m a | 27 | withEnvRES :: (r -> r') -> REST r' e s m a -> REST r e s m a |
24 | withEnvRES fn (ReaderT m) = ReaderT <| fn .> m | 28 | withEnvRES fn (ReaderT m) = ReaderT <| fn .> m |
25 | 29 | ||