HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

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
valueerrorFailWithoutStackTrace :: Fail a -> a
#

Version of runFail restricted to String

Same as errorFail, but without the stack trace:

Example3 expressions
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"
valuemapErrorsFailT :: Functor m => ([e] -> [String]) -> FailT e m a -> FailT m a
#

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:

Example1 expression
runFail (mapErrorsFailT (const []) $ failT "Something went wrong") :: Either String ()Left "No failure reason given"