IdrisDoc: Prelude.Maybe

Prelude.Maybe

toMaybe : Bool -> Lazy a -> Maybe a

Returns Just the given value if the conditional is True
and Nothing if the conditional is False.

raiseToMaybe : Monoid a => Eq a => a -> Maybe a

Returns Nothing when applied to neutral, and Just the value otherwise.

maybe_bind : Maybe a -> (a -> Maybe b) -> Maybe b
maybe : Lazy b -> Lazy (a -> b) -> Maybe a -> b
lowerMaybe : Monoid a => Maybe a -> a

Convert a Maybe a value to an a value, using neutral in the case
that the Maybe value is Nothing.

justInjective : (Just x = Just y) -> x = y
isNothing : Maybe a -> Bool
isJust : Maybe a -> Bool
fromMaybe : Lazy a -> Maybe a -> a

Convert a Maybe a value to an a value by providing a default a value
in the case that the Maybe value is Nothing.

collectJust : Semigroup a => Semigroup (Maybe a)

Transform any semigroup into a monoid by using Nothing as the
designated neutral element and collecting the contents of the
Just constructors using a semigroup structure on a. This is
the behaviour in the Haskell libraries.

data Maybe : Type -> Type
Nothing : Maybe a
Just : a -> Maybe a
data IsJust : Maybe a -> Type

Proof that some Maybe is actually Just

ItIsJust : IsJust (Just x)