Options
All
  • Public
  • Public/Protected
  • All
Menu

Module function/compose

Index

References

Functions

References

Renames and re-exports compose

Functions

  • compose<V0, T1>(fn0: (x0: V0) => T1): (x0: V0) => T1
  • compose<V0, V1, T1>(fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T1
  • compose<V0, V1, V2, T1>(fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T1
  • compose<V0, T1, T2>(fn1: (x: T1) => T2, fn0: (x0: V0) => T1): (x0: V0) => T2
  • compose<V0, V1, T1, T2>(fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T2
  • compose<V0, V1, V2, T1, T2>(fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T2
  • compose<V0, T1, T2, T3>(fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T3
  • compose<V0, V1, T1, T2, T3>(fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T3
  • compose<V0, V1, V2, T1, T2, T3>(fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T3
  • compose<V0, T1, T2, T3, T4>(fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T4
  • compose<V0, V1, T1, T2, T3, T4>(fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T4
  • compose<V0, V1, V2, T1, T2, T3, T4>(fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T4
  • compose<V0, T1, T2, T3, T4, T5>(fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T5
  • compose<V0, V1, T1, T2, T3, T4, T5>(fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T5
  • compose<V0, V1, V2, T1, T2, T3, T4, T5>(fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T5
  • compose<V0, T1, T2, T3, T4, T5, T6>(fn5: (x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T6
  • compose<V0, V1, T1, T2, T3, T4, T5, T6>(fn5: (x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T6
  • compose<V0, V1, V2, T1, T2, T3, T4, T5, T6>(fn5: (x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T6
  • compose(...fns: Func<any>[]): Func<any>
  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • T1

    Parameters

    • fn0: (x0: V0) => T1
        • (x0: V0): T1
        • Parameters

          • x0: V0

          Returns T1

    Returns (x0: V0) => T1

      • (x0: V0): T1
      • Parameters

        • x0: V0

        Returns T1

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • T1

    Parameters

    • fn0: (x0: V0, x1: V1) => T1
        • (x0: V0, x1: V1): T1
        • Parameters

          • x0: V0
          • x1: V1

          Returns T1

    Returns (x0: V0, x1: V1) => T1

      • (x0: V0, x1: V1): T1
      • Parameters

        • x0: V0
        • x1: V1

        Returns T1

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • V2

    • T1

    Parameters

    • fn0: (x0: V0, x1: V1, x2: V2) => T1
        • (x0: V0, x1: V1, x2: V2): T1
        • Parameters

          • x0: V0
          • x1: V1
          • x2: V2

          Returns T1

    Returns (x0: V0, x1: V1, x2: V2) => T1

      • (x0: V0, x1: V1, x2: V2): T1
      • Parameters

        • x0: V0
        • x1: V1
        • x2: V2

        Returns T1

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • T1

    • T2

    Parameters

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0) => T1
        • (x0: V0): T1
        • Parameters

          • x0: V0

          Returns T1

    Returns (x0: V0) => T2

      • (x0: V0): T2
      • Parameters

        • x0: V0

        Returns T2

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • T1

    • T2

    Parameters

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1) => T1
        • (x0: V0, x1: V1): T1
        • Parameters

          • x0: V0
          • x1: V1

          Returns T1

    Returns (x0: V0, x1: V1) => T2

      • (x0: V0, x1: V1): T2
      • Parameters

        • x0: V0
        • x1: V1

        Returns T2

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • V2

    • T1

    • T2

    Parameters

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1, x2: V2) => T1
        • (x0: V0, x1: V1, x2: V2): T1
        • Parameters

          • x0: V0
          • x1: V1
          • x2: V2

          Returns T1

    Returns (x0: V0, x1: V1, x2: V2) => T2

      • (x0: V0, x1: V1, x2: V2): T2
      • Parameters

        • x0: V0
        • x1: V1
        • x2: V2

        Returns T2

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • T1

    • T2

    • T3

    Parameters

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x: V0) => T1
        • (x: V0): T1
        • Parameters

          • x: V0

          Returns T1

    Returns (x: V0) => T3

      • (x: V0): T3
      • Parameters

        • x: V0

        Returns T3

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • T1

    • T2

    • T3

    Parameters

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1) => T1
        • (x0: V0, x1: V1): T1
        • Parameters

          • x0: V0
          • x1: V1

          Returns T1

    Returns (x0: V0, x1: V1) => T3

      • (x0: V0, x1: V1): T3
      • Parameters

        • x0: V0
        • x1: V1

        Returns T3

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • V2

    • T1

    • T2

    • T3

    Parameters

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1, x2: V2) => T1
        • (x0: V0, x1: V1, x2: V2): T1
        • Parameters

          • x0: V0
          • x1: V1
          • x2: V2

          Returns T1

    Returns (x0: V0, x1: V1, x2: V2) => T3

      • (x0: V0, x1: V1, x2: V2): T3
      • Parameters

        • x0: V0
        • x1: V1
        • x2: V2

        Returns T3

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • T1

    • T2

    • T3

    • T4

    Parameters

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x: V0) => T1
        • (x: V0): T1
        • Parameters

          • x: V0

          Returns T1

    Returns (x: V0) => T4

      • (x: V0): T4
      • Parameters

        • x: V0

        Returns T4

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • T1

    • T2

    • T3

    • T4

    Parameters

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1) => T1
        • (x0: V0, x1: V1): T1
        • Parameters

          • x0: V0
          • x1: V1

          Returns T1

    Returns (x0: V0, x1: V1) => T4

      • (x0: V0, x1: V1): T4
      • Parameters

        • x0: V0
        • x1: V1

        Returns T4

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • V2

    • T1

    • T2

    • T3

    • T4

    Parameters

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1, x2: V2) => T1
        • (x0: V0, x1: V1, x2: V2): T1
        • Parameters

          • x0: V0
          • x1: V1
          • x2: V2

          Returns T1

    Returns (x0: V0, x1: V1, x2: V2) => T4

      • (x0: V0, x1: V1, x2: V2): T4
      • Parameters

        • x0: V0
        • x1: V1
        • x2: V2

        Returns T4

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • T1

    • T2

    • T3

    • T4

    • T5

    Parameters

    • fn4: (x: T4) => T5
        • (x: T4): T5
        • Parameters

          • x: T4

          Returns T5

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x: V0) => T1
        • (x: V0): T1
        • Parameters

          • x: V0

          Returns T1

    Returns (x: V0) => T5

      • (x: V0): T5
      • Parameters

        • x: V0

        Returns T5

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • T1

    • T2

    • T3

    • T4

    • T5

    Parameters

    • fn4: (x: T4) => T5
        • (x: T4): T5
        • Parameters

          • x: T4

          Returns T5

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1) => T1
        • (x0: V0, x1: V1): T1
        • Parameters

          • x0: V0
          • x1: V1

          Returns T1

    Returns (x0: V0, x1: V1) => T5

      • (x0: V0, x1: V1): T5
      • Parameters

        • x0: V0
        • x1: V1

        Returns T5

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • V2

    • T1

    • T2

    • T3

    • T4

    • T5

    Parameters

    • fn4: (x: T4) => T5
        • (x: T4): T5
        • Parameters

          • x: T4

          Returns T5

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1, x2: V2) => T1
        • (x0: V0, x1: V1, x2: V2): T1
        • Parameters

          • x0: V0
          • x1: V1
          • x2: V2

          Returns T1

    Returns (x0: V0, x1: V1, x2: V2) => T5

      • (x0: V0, x1: V1, x2: V2): T5
      • Parameters

        • x0: V0
        • x1: V1
        • x2: V2

        Returns T5

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    Parameters

    • fn5: (x: T5) => T6
        • (x: T5): T6
        • Parameters

          • x: T5

          Returns T6

    • fn4: (x: T4) => T5
        • (x: T4): T5
        • Parameters

          • x: T4

          Returns T5

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x: V0) => T1
        • (x: V0): T1
        • Parameters

          • x: V0

          Returns T1

    Returns (x: V0) => T6

      • (x: V0): T6
      • Parameters

        • x: V0

        Returns T6

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    Parameters

    • fn5: (x: T5) => T6
        • (x: T5): T6
        • Parameters

          • x: T5

          Returns T6

    • fn4: (x: T4) => T5
        • (x: T4): T5
        • Parameters

          • x: T4

          Returns T5

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1) => T1
        • (x0: V0, x1: V1): T1
        • Parameters

          • x0: V0
          • x1: V1

          Returns T1

    Returns (x0: V0, x1: V1) => T6

      • (x0: V0, x1: V1): T6
      • Parameters

        • x0: V0
        • x1: V1

        Returns T6

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Type parameters

    • V0

    • V1

    • V2

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    Parameters

    • fn5: (x: T5) => T6
        • (x: T5): T6
        • Parameters

          • x: T5

          Returns T6

    • fn4: (x: T4) => T5
        • (x: T4): T5
        • Parameters

          • x: T4

          Returns T5

    • fn3: (x: T3) => T4
        • (x: T3): T4
        • Parameters

          • x: T3

          Returns T4

    • fn2: (x: T2) => T3
        • (x: T2): T3
        • Parameters

          • x: T2

          Returns T3

    • fn1: (x: T1) => T2
        • (x: T1): T2
        • Parameters

          • x: T1

          Returns T2

    • fn0: (x0: V0, x1: V1, x2: V2) => T1
        • (x0: V0, x1: V1, x2: V2): T1
        • Parameters

          • x0: V0
          • x1: V1
          • x2: V2

          Returns T1

    Returns (x0: V0, x1: V1, x2: V2) => T6

      • (x0: V0, x1: V1, x2: V2): T6
      • Parameters

        • x0: V0
        • x1: V1
        • x2: V2

        Returns T6

  • Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

    Note: The result of compose is not automatically curried.

    example
     var f = compose(x => x + 1, x => -x, Math.pow);

    f(3, 4); // -(3^4) + 1

    Parameters

    • Rest ...fns: Func<any>[]

    Returns Func<any>

Generated using TypeDoc