Releases: 92green/fronads
Releases · 92green/fronads
Either.toPromise()
Eithers can now be turned into to a promise.
Left(value).toPromise() -> Promise.reject(value);
Right(value).toPromise() -> Promise.resolve(value);
Better Either Generics
BREAKING:
Either now has types for left and right
// New
function(): Either<LeftType, RightType> {}
// Old
function(): Either<RightType> {}
PerhapsEither, Maybe.ap
v0.15.0 0.15.0
None() -> None
BREAKING: None
is now a constant not a factory.
Remove RequestState
BREAKING: RequestState no longer exists. Create your own StateFunctor
Generic Types!
New
- Generic flow types
const name: Maybe<string> = Some('steve');
// Will throw flow errors
name.flatMap(nn => Right(nn));
name.map(nn => 2);
// Will not throw flow errors
name.flatMap(nn => None());
name.map(nn => `${nn} is cool!`);
Deprecated
Maybe, Either, Identity
exports are now just their classes/types. Their constructor functions have been moved to:MaybeFactory, EitherFactory, IdentityFactory
.
Add .flow files
v0.11.0 0.11.0
Add Task monad
Task lets you create a description of an action that is resolved via a callback.
It is useful for asynchronous operations. It can be thought of as a stricter more monadic version of a promise.
Compare StateFunctors
- Add equals method to the StateFunctor.
- Don't allow Nones to filter.
Filters & toLeft & toRight
- Add
filter
methods to Maybe and Either. - Add
toLeft
andtoRight
methods to Either.