hextra-1.1.0.1: Generic and niche utility functions and more for Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hextra.Maybe

Description

Helpful extra functions concerning Maybe

Synopsis

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