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/free.ts";

Chain Free computations together.

@example
import { flatmap, node } from "./free.ts";
import { pipe } from "./fn.ts";

const free = node(5);
const chained = pipe(
  free,
  flatmap(n => node(n * 2))
);

console.log(chained); // { tag: "Node", value: 10 }
function flatmap<A, I>(faui: (a: A) => Free<I>): (ua: Free<A>) => Free<I>;
§
flatmap<A, I>(faui: (a: A) => Free<I>): (ua: Free<A>) => Free<I>
[src]

§Type Parameters

§Parameters

§
faui: (a: A) => Free<I>
[src]

§Return Type

§
(ua: Free<A>) => Free<I>
[src]