fromJust -package:sbv

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

Examples

Basic usage:
>>> fromJust (Just 1)
1
>>> 2 * (fromJust (Just 10))
20
>>> 2 * (fromJust Nothing)
*** Exception: Maybe.fromJust: Nothing
...
WARNING: This function is partial. You can use case-matching instead.
Extracts the element out of a Just and throws an error if the argument is Nothing.
The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing.

Examples

Basic usage:
>>> fromJust (Just 1)
1
>>> 2 * (fromJust (Just 10))
20
>>> 2 * (fromJust Nothing)
*** Exception: Maybe.fromJust: Nothing
The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing.

Examples

Basic usage:
>>> fromJust (Just 1)
1
>>> 2 * (fromJust (Just 10))
20
>>> 2 * (fromJust Nothing)
*** Exception: Maybe.fromJust: Nothing
...
Convert between Just and its value.
Converts a Maybe into a value or throws an error if the Maybe is Nothing.
An alternative name for fromMaybe, to fit the naming scheme of this package. Generally using fromMaybe directly would be considered better style.
Convert a possibly-incomplete specification for what to convert into one which can be executed. Calls error when data is missing.
Extract the element out of a Just' and throws an error if its argument is Nothing'.
Same as fromJust, but returns a bottom/undefined value that other Clash constructs are aware of.
Extract value from Just, failing with AuthOtherFailure on Nothing.
fromJust but with a better error message if it fails. Use this only where it shouldn't fail!