Module

x/functional/mod.ts>chainLift

Common Functional Programming Algebraic data types for JavaScript that is compatible with most modern browsers and Deno.
Latest
variable chainLift
import { chainLift } from "https://deno.land/x/functional@v1.3.4/mod.ts";

chainLift

(a -> b -> c) -> Chainable a -> Functor b -> Chainable c

This function is similar to lift but is chainable.

import Task from "https://deno.land/x/functional@v1.3.2/library/Task.js";
import { chainLift } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";

const hogeFuga = useWith(
  chainLift(curry((x, y) => Task.of(x * y))),
  [
    x => Task.of(x),
    x => Task.of(x)
  ]
);

const container = await hogeFuga(42, 24).run();

const value = safeExtract("Failed.", container);

assertEquals(value, 1008);