An asynchronous either monad compatible with Folktale result

Usage no npm install needed!

<script type="module">
  import fantasyResultAsync from '';



This is fantasy land, Folktale, compatible Either monad that can be used for Asynchronous error handling. Is all about using the same good functional pattern of Either along with Promises to deal with asynchronicity without deviating from the functional coding styles. An alternative to data.task and Fluture.js, that builds up on promise familiarity and uses the Either functional pattern. The idea of async Either is the coyoneda lema.

Example use using chaining with Folktale Result.Ok

 const Result = require('folktale/result');
   const isDigit = (character) =>

   const digit = (input) => {
      const character = input.slice(0, 1);
      const rest = input.slice(1);

      return isDigit(character) ? Result.Ok([character, rest])
         :      /* otherwise */       Result.Error(`Expected a digit (0..9), got "${character}"`);