@mikuroxina/mini-fn
    Preparing search index...

    Function map

    • 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: T) => U

        A function which maps from T to U.

      Returns (c: Cat.Cat<T>) => Cat.Cat<U>

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

      Examples

      const actual = map((v: number) => v / 2)(cat(10)).value;
      expect(actual).toStrictEqual(5);