A function which maps from T
to U
.
A lifted function which maps from Cat<T>
to Cat<U>
.
import { cat, map } from "./cat.ts";
import { assertEquals } from "../deps.ts";
const actual = map((v: number) => v / 2)(cat(10)).value;
assertEquals(actual, 5);
Generated using TypeDoc
Maps an inner value of a
Cat
into another one by applying a function. It is useful to lift a function forCat
.