common-stuff
    Preparing search index...

    Function curry

    • Returns a curried equivalent of the provided function.

      Curried function can accept one or multiple parameter at the time:

      • g(1)(2)(3)
      • g(1)(2, 3)
      • g(1, 2)(3)
      • g(1, 2, 3)

      The special placeholder value __ may be used to specify "gaps", allowing partial application of any combination of arguments, regardless of their positions:

      • g(1, 2, 3)
      • g(_, 2, 3)(1)
      • g(_, _, 3)(1)(2)
      • g(_, _, 3)(1, 2)
      • g(_, 2)(1)(3)
      • g(_, 2)(1, 3)
      • g(_, 2)(_, 3)(1)

      Type Parameters

      • T1
      • T2
      • R

      Parameters

      • fn: (t1: T1, t2: T2) => R

      Returns Curry2<T1, T2, R>

      const addNumbers = (a, b, c, d) => a + b + c + d

      const addLastNumber = curry(addNumbers)(5, 5, 5)

      addLastNumber(5)

      const addFirst = curry(addNumbers)(__, 5, 5, 5)
      addFirst(5)
    • Returns a curried equivalent of the provided function.

      Curried function can accept one or multiple parameter at the time:

      • g(1)(2)(3)
      • g(1)(2, 3)
      • g(1, 2)(3)
      • g(1, 2, 3)

      The special placeholder value __ may be used to specify "gaps", allowing partial application of any combination of arguments, regardless of their positions:

      • g(1, 2, 3)
      • g(_, 2, 3)(1)
      • g(_, _, 3)(1)(2)
      • g(_, _, 3)(1, 2)
      • g(_, 2)(1)(3)
      • g(_, 2)(1, 3)
      • g(_, 2)(_, 3)(1)

      Type Parameters

      • T1
      • T2
      • T3
      • R

      Parameters

      Returns Curry3<T1, T2, T3, R>

      const addNumbers = (a, b, c, d) => a + b + c + d

      const addLastNumber = curry(addNumbers)(5, 5, 5)

      addLastNumber(5)

      const addFirst = curry(addNumbers)(__, 5, 5, 5)
      addFirst(5)
    • Returns a curried equivalent of the provided function.

      Curried function can accept one or multiple parameter at the time:

      • g(1)(2)(3)
      • g(1)(2, 3)
      • g(1, 2)(3)
      • g(1, 2, 3)

      The special placeholder value __ may be used to specify "gaps", allowing partial application of any combination of arguments, regardless of their positions:

      • g(1, 2, 3)
      • g(_, 2, 3)(1)
      • g(_, _, 3)(1)(2)
      • g(_, _, 3)(1, 2)
      • g(_, 2)(1)(3)
      • g(_, 2)(1, 3)
      • g(_, 2)(_, 3)(1)

      Type Parameters

      • T1
      • T2
      • T3
      • T4
      • R

      Parameters

      Returns Curry4<T1, T2, T3, T4, R>

      const addNumbers = (a, b, c, d) => a + b + c + d

      const addLastNumber = curry(addNumbers)(5, 5, 5)

      addLastNumber(5)

      const addFirst = curry(addNumbers)(__, 5, 5, 5)
      addFirst(5)
    • Returns a curried equivalent of the provided function.

      Curried function can accept one or multiple parameter at the time:

      • g(1)(2)(3)
      • g(1)(2, 3)
      • g(1, 2)(3)
      • g(1, 2, 3)

      The special placeholder value __ may be used to specify "gaps", allowing partial application of any combination of arguments, regardless of their positions:

      • g(1, 2, 3)
      • g(_, 2, 3)(1)
      • g(_, _, 3)(1)(2)
      • g(_, _, 3)(1, 2)
      • g(_, 2)(1)(3)
      • g(_, 2)(1, 3)
      • g(_, 2)(_, 3)(1)

      Type Parameters

      • T1
      • T2
      • T3
      • T4
      • T5
      • R

      Parameters

      Returns Curry5<T1, T2, T3, T4, T5, R>

      const addNumbers = (a, b, c, d) => a + b + c + d

      const addLastNumber = curry(addNumbers)(5, 5, 5)

      addLastNumber(5)

      const addFirst = curry(addNumbers)(__, 5, 5, 5)
      addFirst(5)
    • Returns a curried equivalent of the provided function.

      Curried function can accept one or multiple parameter at the time:

      • g(1)(2)(3)
      • g(1)(2, 3)
      • g(1, 2)(3)
      • g(1, 2, 3)

      The special placeholder value __ may be used to specify "gaps", allowing partial application of any combination of arguments, regardless of their positions:

      • g(1, 2, 3)
      • g(_, 2, 3)(1)
      • g(_, _, 3)(1)(2)
      • g(_, _, 3)(1, 2)
      • g(_, 2)(1)(3)
      • g(_, 2)(1, 3)
      • g(_, 2)(_, 3)(1)

      Type Parameters

      • T1
      • T2
      • T3
      • T4
      • T5
      • T6
      • R

      Parameters

      Returns Curry6<T1, T2, T3, T4, T5, T6, R>

      const addNumbers = (a, b, c, d) => a + b + c + d

      const addLastNumber = curry(addNumbers)(5, 5, 5)

      addLastNumber(5)

      const addFirst = curry(addNumbers)(__, 5, 5, 5)
      addFirst(5)
    • Returns a curried equivalent of the provided function.

      Curried function can accept one or multiple parameter at the time:

      • g(1)(2)(3)
      • g(1)(2, 3)
      • g(1, 2)(3)
      • g(1, 2, 3)

      The special placeholder value __ may be used to specify "gaps", allowing partial application of any combination of arguments, regardless of their positions:

      • g(1, 2, 3)
      • g(_, 2, 3)(1)
      • g(_, _, 3)(1)(2)
      • g(_, _, 3)(1, 2)
      • g(_, 2)(1)(3)
      • g(_, 2)(1, 3)
      • g(_, 2)(_, 3)(1)

      Type Parameters

      • T1
      • R

      Parameters

      • fn: (t1: T1) => R

      Returns Curry1<T1, R>

      const addNumbers = (a, b, c, d) => a + b + c + d

      const addLastNumber = curry(addNumbers)(5, 5, 5)

      addLastNumber(5)

      const addFirst = curry(addNumbers)(__, 5, 5, 5)
      addFirst(5)