Just package:yesod-paginator

elemIndexJust op = fromJust . elemIndex op
findIndexJust op = fromJust . findIndex op
findJust op = fromJust . find op
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
An alternative name for fromMaybe, to fit the naming scheme of this package. Generally using fromMaybe directly would be considered better style.
The isJust function returns True iff its argument is of the form Just _.

Examples

Basic usage:
>>> isJust (Just 3)
True
>>> isJust (Just ())
True
>>> isJust Nothing
False
Only the outer constructor is taken into consideration:
>>> isJust (Just Nothing)
True
lookupJust key = fromJust . lookup key