Correct implementation of the Maybe monad in JavaScript
Install with component(1):
$ component install jasonkuhrt/maybe
Install with npm(1)
$ npm install jasonkuhrt/maybe
(a) -> Maybe a
==========
(a -> b) -> Maybe b
Passed function is automatically lifted.
All package functions are partially applied with the monadic-value and exposed as properties on the Maybe a
value. e.g.:
var some_unstable_value = Maybe(null);
// Pure style
Maybe.is_nothing(some_unstable_value) // true
// Chain style
some_unstable_value.is_nothing() // true
==========
(else_value, (a -> b), Maybe a) -> b
(Maybe a) -> Bool
(Maybe a) -> Bool
(Maybe a) -> Bool
(else_value, Maybe a) -> a
BSD-2-Clause