How to use the fluture.Future.of function in fluture

To help you get started, we’ve selected a few fluture examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github char0n / monad-t / tonicExample.js View on Github external
require('fantasy-land');
const { Future } = require('fluture');
const { Identity, Either } = require('monet');

const { MonetEitherT: EitherT } = require('monad-t');
const { FlutureTMonetEither: FutureTEither } = require('monad-t');


EitherT(Identity.of(1)); // => Either.Right(1)

FutureTEither.of(Future.of(Either.Right(1))); // => FlutureTMonetEither(1)
github char0n / monad-t / src / FlutureTMonetEither / index.js View on Github external
FlutureTMonetEither.prototype.and = function and(futureEither) {
  return this.constructor.of(
    Future
      .of(either1 => either2 => either1.chain(always(either2)))
      .ap(this.run)
      .ap(futureEither.run)
  );
};
github char0n / monad-t / src / FlutureTMonetEither / index.js View on Github external
value = yield state.value.run.chain((either) => {
          if (either.isLeft()) {
            return Future.reject(either.left());
          }

          return Future.of(either.right());
        });
github char0n / monad-t / src / FlutureTMonetEither / utils.js View on Github external
const liftEither = m => FlutureTMonetEither.of(Future.of(m));
github char0n / monad-t / src / FlutureTMonetEither / index.js View on Github external
FlutureTMonetEither.fromValue = function fromValue(val) {
  return this[of](Future.of(Either.Right(val)));
};
github char0n / monad-t / src / FlutureTMonetEither / index.js View on Github external
FlutureTMonetEither.fromEither = function fromEither(either) {
  return this[of](Future.of(either));
};
github char0n / monad-t / src / FlutureTMonetEither / index.js View on Github external
  return this[chain](val => this.constructor.of(Future.of(fn(val))));
};