Classes
Methods
-
static isJust(x) → {boolean}
-
Checks for
Just.Parameters:
Name Type Description x* Returns:
boolean -
static isMaybe(x) → {boolean}
-
Checks for maybe.
Parameters:
Name Type Description x* .
Returns:
boolean -
static just(x) → {Just}
-
Functional constructor (function that returns an instance) for
Just- Same asnew Just(...)(just shorter and can be used as a function).Parameters:
Name Type Description xJust | * Returns:
Just -
static maybe(replacement, fn, maybeInst) → {*}
-
The maybe function takes a
replacementvalue, a function (unary operation), and a Maybe value. If the Maybe value isNothing, the function returns thereplacementvalue. Otherwise, it applies the function to the value contained by theJustand returns the result.Parameters:
Name Type Description replacement* fnfunction Unary operation.
maybeInstNothing | Just | * Maybe instance or non-maybe value.
Returns:
* -
static maybeEqual(a, b) → {boolean}
-
Equality operator for maybes.
Parameters:
Name Type Description a* Maybe 1.
b* Maybe 2.
Returns:
boolean -
static nothing() → {Nothing}
-
Returns
Nothing.Returns:
Nothing -
static toJust(x) → {Just}
-
Ensures
JustParameters:
Name Type Description xJust | * Returns:
Just -
static toMaybe(x) → {Maybe}
-
Creates maybe from value.
Parameters:
Name Type Description x* -
static unWrapJust(x) → {*}
-
Unwraps just (recursively).
Parameters:
Name Type Description x* Expected
Just.Returns:
* -
static unWrapMaybe(x) → {*}
-
Unwraps maybe (recursively).
Parameters:
Name Type Description x* Expected
Maybe.Returns:
*