import { async_either } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { chain } = async_either;
Chain AsyncEither based computations together in a pipeline
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import * as TE from "./async_either.ts";
import * as E from "./either.ts";
import { pipe } from "./fn.ts";
const ta = pipe(
TE.of(1),
TE.chain(n => TE.of(n*2)),
TE.chain(n => TE.of(n**2))
)
assertEquals(await ta(), E.right(4))
Parameters
fati: (a: A) => AsyncEither<J, I>
Returns
<B>(ta: AsyncEither<B, A>) => AsyncEither<B | J, I>