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

map

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

Apply a function to the value in a Free structure.

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

const free = node(5);
const doubled = pipe(
  free,
  map(n => n * 2)
);

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

§Type Parameters

§Parameters

§
fai: (a: A) => I
[src]

§Return Type

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