gribouille / elm-prelude / Prelude.Maybe

Extra Maybe functions.

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

Takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.

mapMaybe : (a -> Maybe b) -> List a -> List b

Version of map which throw out elements.

catMaybes : List (Maybe a) -> List a

Takes a list of Maybe and returns a list of all the Just values.

isJust : Maybe a -> Basics.Bool

Returns True if its argument is of the form Just _

isNothing : Maybe a -> Basics.Bool

Returns True if its argument is Nothing