HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerio-0.1.22.0Haskell2010

RIO.Partial

Partial functions. Import as:

import qualified RIO.Partial as RIO'
  • 2 values
  • Packagerio-0.1.22.0
  • Exports5
  • LanguageHaskell2010
  • LicenceMIT
  • SourcePartial.hs
valuefromJust :: HasCallStack => Maybe a -> a
#

The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing.

Examples

Basic usage:

Example1 expression
fromJust (Just 1)1
Example1 expression
2 * (fromJust (Just 10))20
Example1 expression
2 * (fromJust Nothing)*** Exception: Maybe.fromJust: Nothing...

WARNING: This function is partial. You can use case-matching instead.

valueread :: Read a => String -> a
#

The read function reads input from a string, which must be completely consumed by the input process. read fails with an error if the parse is unsuccessful, and it is therefore discouraged from being used in real applications. Use readMaybe or readEither for safe alternatives.

Example1 expression
read "123" :: Int123
Example1 expression
read "hello" :: Int*** Exception: Prelude.read: no parse
methodpred :: a -> a
#

Predecessor of a value. For numeric types, pred subtracts 1.

methodsucc :: a -> a
#

Successor of a value. For numeric types, succ adds 1.