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

Map over the covariant value A in State<E, A>.

@example
import * as S from "./state.ts";
import * as A from "./array.ts";
import { pipe } from "./fn.ts";

const work = pipe(
  S.id<number>(),
  S.map(n => A.range(n)),
);

const result1 = work(1); // [[0], 1]
const result2 = work(3); // [[0, 1, 2], 3]
function map<A, I>(fai: (a: A) => I): <B>(ta: State<B, A>) => State<B, I>;
§
map<A, I>(fai: (a: A) => I): <B>(ta: State<B, A>) => State<B, I>
[src]

§Type Parameters

§Parameters

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

§Return Type

§
<B>(ta: State<B, A>) => State<B, I>
[src]