Maybe
Monadics

Next:Either


Vocabulary
monadics

Word description
A Maybe either holds Just a value or is Nothing. Operations done on Nothing will return Nothing:
USING: math monadics prettyprint ; 5 just [ 1 + ] fmap .
T{ Just { value 6 } }

USING: math monadics prettyprint ; [ + ] 5 just <$> Nothing <*> .
Nothing

Just values are constructed with the just word, or turned from a generalized boolean by >maybe.

Not to be confused with the all-lowercase maybe.

Definition


Methods