monads library

Classes

Failure<T>
Just<T>
Maybe<T>
Nothing
Result<S extends Success, F extends Failure>
Success<T>

Functions

Err<T>(T _) Result<Success<void>, Failure<T>>
Err(1)
Ok<T>(T _) Result<Success<T>, Failure<void>>
Ok('My string!')
toResultOr<S, F>(Function f, { F failure: null }) Result<Success<S>, Failure<F>>
toResultOr<Null, Exception>(() => throw Exception('q')); // Failure<Exception> toResultOr<Null, String>(() => throw Exception(1), failure: 'My message'); // Success