ModuleFailT-0.1.2.0Haskell2010
Control.Monad.Trans.Fail.String
This module contains a synonym for FailT e m a transformer, where failure
type e is restricted to String. All functions in this module have the same
names and are a drop-in replacement for Control.Monad.Trans.Fail module, except with
monomorphic failure type.
- 3 types
- 17 values
- PackageFailT-0.1.2.0
- Exports20
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceString.hs
Version of runFailLast restricted to String
Version of runFailAgg restricted to String
Version of errorFail restricted to String
Throw an error if there was a failure, otherwise return the result of monadic computation. Use throwFailT in case you'd like to handle an actual exception.
Version of runFail restricted to String
Same as errorFail, but without the stack trace:
errorFailWithoutStackTrace (fail "This didn't work" :: Fail ())*** Exception: "This didn't work"import Control.ApplicativeerrorFailWithoutStackTrace (fail "This didn't work" <|> pure "That Worked" :: Fail String)"That Worked"
An exception that is produced by the FailT monad transformer.
Constructors
FailException :: (Typeable e, Show e) => [e] -> CallStack -> FailExceptionfailMessages :: [e]failCallStack :: CallStack
Instances2Show, Exception
Show FailExceptionDefined in FailT-0.1.2.0 · Control.Monad.Trans.FailException FailExceptionDefined in FailT-0.1.2.0 · Control.Monad.Trans.Fail
Version of runFailLastT restricted to String
Version of runFailAggT restricted to String
Version of hoistFailT restricted to String
Change the underlying monad with the hoisting function
Version of F.mapErrorsFail, where resulting type is restricted to String
Map a function over the aggregation of errors in the FailT monad. Could be used for example for clearing our all of the aggregated error messages:
runFail (mapErrorsFailT (const []) $ failT "Something went wrong") :: Either String ()Left "No failure reason given"
Version of exceptFailT restricted to String
Version of throwErrorFailT restricted to String
Same as exceptFailT, but works with any MonadError.
import Control.Monad.Trans.Fail.StringthrowErrorFailT (fail "A bad thing" >> pure () :: FailT (Except FailException) ())ExceptT (Identity (Left FailException"A bad thing"CallStack (from HasCallStack):...
Version of throwFailT restricted to String