Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Helpful extra functions concerning Maybe
Synopsis
- fromNothing :: forall a. a -> Maybe a -> a
- catchNothing :: forall a b. b -> (a -> Maybe b) -> a -> b
Documentation
fromNothing :: forall a. a -> Maybe a -> a Source #
Extracts a value from a Maybe value, uses replacement value in case of Nothing.
catchNothing :: forall a b. b -> (a -> Maybe b) -> a -> b Source #
Composes fromNothing with a function. Useful to make a function that relies on another function that returns a Maybe