• Applies the function to transform the continuation passed to the computation.

    Examples

    import { assertEquals } from "../deps.ts";
    import { runCont, withCont } from "./cont.ts";

    const cont = withCont((fn: (x: number) => boolean) => (a: string) =>
    fn(parseInt(a, 10))
    )(
    (callback) => callback("foo"),
    );
    const actual = runCont(cont)(Number.isNaN);
    assertEquals(actual, true);

    Type Parameters

    • A

    • B

    • R

    Parameters

    • callback: ((fn) => ((a) => R))
        • (fn): ((a) => R)
        • Parameters

          • fn: ((b) => R)
              • (b): R
              • Parameters

                • b: B

                Returns R

          Returns ((a) => R)

            • (a): R
            • Parameters

              • a: A

              Returns R

    Returns ((cont) => Cont<R, B>)

      • (cont): Cont<R, B>
      • Parameters

        Returns Cont<R, B>

Generated using TypeDoc