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

Modulebase-4.20.2.0Haskell2010

Foreign.Marshal.Error

Routines for testing return values and raising a userError exception in case of values indicating an error state.

  • 6 values
  • Packagebase-4.20.2.0
  • Exports6
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceError.hs
valuethrowIf
  1. :: (a -> Bool)

    error condition on the result of the IO action

  2. -> (a -> String)

    computes an error message from erroneous results of the IO action

  3. -> IO a

    the IO action to be executed

  4. -> IO a
#

Execute an IO action, throwing a userError if the predicate yields True when applied to the result returned by the IO action. If no exception is raised, return the result of the computation.

valuevoid :: IO a -> IO ()
#

Deprecated. use void instead

Discard the return value of an IO action