FR
PréludeChargé par défaut — aucun import nécessaire.

Maybe and Either operations

Synopsis
maybe : b -> (a -> b) -> Maybe a -> b

Eliminate a Maybe: provide a default and a function. maybe 0 f Nothing = 0 ; maybe 0 f (Just x) = f x

fromMaybe : a -> Maybe a -> a

Extract the value from a Maybe, or use a default.

either : (a -> c) -> (b -> c) -> Either a b -> c

Eliminate an Either by providing handlers for both sides.