• Maps an inner value of a Cat into another one by applying a function. It is useful to lift a function for Cat.

    Type Parameters

    • T

    • U

    Parameters

    • fn: ((t) => U)

      A function which maps from T to U.

        • (t): U
        • Parameters

          • t: T

          Returns U

    Returns ((c) => Cat<U>)

    A lifted function which maps from Cat<T> to Cat<U>.

    Examples

    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