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

    Function flatMap

    • Maps and flattens the hom with fn.

      Type Parameters

      • X

      Returns <A, B>(fn: (a: A) => Fn<X, B>) => (a: Fn<X, A>) => Fn<X, B>

      The mapped hom X => B.

      Examples

      const mapper = flatMap<number>()((x: number) => (y: number) => x * y);
      expect(mapper((x) => x + 1)(3)).toStrictEqual(12);