HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleerrors-2.3.0Haskell98

Control.Error.Util

This module exports miscellaneous error-handling functions.

  • 2 types
  • 30 values
  • Packageerrors-2.3.0
  • Exports32
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceUtil.hs

Conversion

10 declarations

Use these functions to convert between Maybe, Either, MaybeT, and ExceptT.

Bool

1 declaration
valuebool :: a -> a -> Bool -> a
#

Case analysis for the Bool type.

bool a b c == if c then b else a

Maybe

1 declaration
value(?:) :: Maybe a -> a -> a
#

An infix form of fromMaybe with arguments flipped.

MaybeT

5 declarations
valuemaybeT :: Monad m => m b -> (a -> m b) -> MaybeT m a -> m b
#

Case analysis for MaybeT

Use the first argument if the MaybeT computation fails, otherwise apply the function to the successful result.

Either

5 declarations

ExceptT

5 declarations
valueexceptT :: Monad m => (a -> m c) -> (b -> m c) -> ExceptT a m b -> m c
#

Fold an ExceptT by providing one continuation for each constructor

Error Reporting

2 declarations
valueerr :: Text -> IO ()
#

Write a string to standard error

valueerrLn :: Text -> IO ()
#

Write a string with a newline to standard error

Exceptions

3 declarations