aboutsummaryrefslogtreecommitdiff
path: root/src/ImageHoster
diff options
context:
space:
mode:
Diffstat (limited to 'src/ImageHoster')
-rw-r--r--src/ImageHoster/Monad.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ImageHoster/Monad.hs b/src/ImageHoster/Monad.hs
index a05d59d..198ebd5 100644
--- a/src/ImageHoster/Monad.hs
+++ b/src/ImageHoster/Monad.hs
@@ -7,6 +7,7 @@ module ImageHoster.Monad
, FallibleApp
-- * Conversion functions
, runFallibleApp
+ , fallible
, liftApp
, run
-- * Data accessors
@@ -54,6 +55,11 @@ runFallibleApp :: FallibleApp a -> App (Maybe a)
runFallibleApp = runMaybeT
+-- | Ensure that a computation that can fail runs as a 'FallibleApp'.
+fallible :: App (Maybe a) -> FallibleApp a
+fallible = MaybeT
+
+
-- | Lift an 'App' to a 'FallibleApp' that never fails.
liftApp :: App a -> FallibleApp a
liftApp a = MaybeT $ Just <$> a