HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleerrors-2.3.0Haskell98

Control.Error.Util

This module exports miscellaneous error-handling functions.

Contents
  1. Conversion
  2. Bool
  3. Maybe
  4. MaybeT
  5. Either
  6. ExceptT
  7. Error Reporting
  8. Exceptions
Synopsis
  • Packageerrors-2.3.0
  • Exports32
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceUtil.hs

Conversion

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

Bool

valuebool :: a -> a -> Bool -> a

Case analysis for the Bool type.

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

Maybe

MaybeT

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

ExceptT

Error Reporting

Exceptions