Maybe is a container that may contain one or zero elements.
Maybe is an instance of the following abstractions: functor, applicative, monad, foldable and traversable.
Import with.
import {just, nothing, ...} from "jabz/maybe";
Returns true if m is empty.
isNothing(nothing); //=> true
isNothing(just(3)); //=> false
Returns true if m is contains a value.
isJust(nothing); //=> false
isJust(just(3)); //=> true
Extracts a the potential value from `m` with `a` as a fallback.
fromMaybe(5, nothing); //=> 5
fromMaybe(5, just(3)); //=> 3
If m is nothing return b. Otherwise, extract the value, pass it through f and return it.
maybe("--:--", (d) => d.getMinutes() + ":" + d.getSeconds, maybeTime);