Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

flatmap

import { flatmap } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/identity.ts";

Chain Identity computations together.

@example
import { flatmap, wrap } from "./identity.ts";
import { pipe } from "./fn.ts";

const identity = wrap(5);
const chained = pipe(
  identity,
  flatmap(n => wrap(n * 2))
);

console.log(chained); // 10
function flatmap<A, I>(fati: (a: A) => Identity<I>): (ta: Identity<A>) => Identity<I>;
§
flatmap<A, I>(fati: (a: A) => Identity<I>): (ta: Identity<A>) => Identity<I>
[src]

§Type Parameters

§Parameters

§
fati: (a: A) => Identity<I>
[src]

§Return Type

§
(ta: Identity<A>) => Identity<I>
[src]