Release notes

Folktale v2.1.0 is a very modest release, mostly with documentation fixes.

You can look at the full changelog for details.

Making things more consistent

There were two inconsistent functions in Folktale 2:

  • Future.recover was called .orElse in every other data structure. A new .orElse method was added to Future, and consequently .recover has been deprecated.

  • nullableToResult and Result.fromNullable only received a nullable as a parameter, but the Validation equivalent let people define the value to use in case of null or undefined. These functions now optionally take a fallback value.

    The number of arguments provided to the function defines which behaviour will be used. This should be backwards compatible, unless you’ve been passing more than one argument to that function (which can happen in, for example,

Addressing some of the problems with .toString

The ADT module is still pretty experimental, and so are derivations. The derived .toString method turned out to be more trouble, however:

The big issue with .toString is that too many things in JavaScript will invoke it even when you don’t want that. So, yeah, this will hopefully be addressed soon.


As always, a huge thank you to everyone who contributed to improving Folktale, by reporting errors, sending feedback, talking about it, sending patches, etc.

A special thank you to @diasbruno, @gvillalta99, @MichaelQQ, @stabbylambda, @floriansimon1, and @scotttrinh