HORIZON HASKELLDocslts/ghc-9.14.x99ffbb82026-10-19Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 99ffbb8 · 2026-10-19

ModuleFailT-0.1.2.0Haskell2010

Control.Monad.Trans.Fail.Text

This module contains a synonym for FailT e m a transformer, where failure type e is restricted to Text. 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.

Synopsis
  • PackageFailT-0.1.2.0
  • Exports20
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceText.hs

Version of errorFailWithoutStackTrace restricted to Text

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] -> [Text]) -> FailT e m a -> FailT m a

Version of F.mapErrorsFail, where resulting type is restricted to Text

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 [] :: [Text] -> [Text]) $ fail "Something went wrong" >> pure ())Left "No failure reason given"