Skip to content

Generic Types!

Choose a tag to compare

@allanhortle allanhortle released this 27 Sep 06:16
· 33 commits to master since this release

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.