Currying
Currying is the transformation of a function that accepts multiple arguments into a sequence of functions that accept arguments incrementally, typically one at a time.
The Joy of JavaScript
A technique that transforms a function of multiple arguments into a sequence of functions each taking a single argument.
- How it is used
- Adapts multi-argument functions into configurable steps that fit function-composition pipelines.
- How deep it goes
- Defines stepwise application, works through manual and helper-based currying, and flags an arity caveat; reviews closures without treating them in depth.
- Examples
- Uses nested addition, configurable buffer decoding, property access, object hashing, and curried array mapping.
- What you can do after
- Build it from scratch with nested functions or a curry helper, then configure functions for composition.
Functional Programming in JavaScript
A function-transformation technique that converts a function taking multiple arguments into a sequence of functions each taking fewer arguments, often unary functions.
- How it is used
- Uses currying to preconfigure dependencies and reduce functions to unary steps for functional pipelines.
- How deep it goes
- Defines deferred curried evaluation, builds a two-argument helper, and examines its execution-context stack overhead.
- Examples
- Demonstrates type checking, student lookup, configurable logging, DOM output, and a nested-loop addition benchmark.
- What you can do after
- Apply it via R.curry or a manual helper to create reusable, partially configured JavaScript functions.
Read how Functional Programming in JavaScript explains currying →
Functional Programming in C#, Second Edition
Currying transforms a function that takes multiple arguments into a sequence of unary functions.
- How it is used
- Uses currying to make partial application convenient and to map multi-argument functions over Option values.
- How deep it goes
- Defines curried signatures and closures, then implements manual and generic currying for binary and ternary functions.
- Examples
- Uses greeting functions and multiplication mapped over an Option; exercises explore remainder and phone-number factories.
- What you can do after
- Build it from scratch using nested lambdas or generic Curry overloads, and apply the resulting functions incrementally.
Read how Functional Programming in C#, Second Edition explains currying →
Learn Haskell by Example
curry is a Haskell function that converts a function taking a pair into a function taking two arguments.
- How it is used
- Uses curried and uncurried functions to turn command-line options into composable CSV transformations.
- How deep it goes
- Defines currying and its dual, then demonstrates tuple adaptation with `uncurry`; it stops short of deeper implementation details.
- Examples
- Demonstrates `f = \x -> \y -> ...`, `uncurry slice`, optional intervals, and composed CSV operations.
- What you can do after
- Apply currying and uncurrying in Haskell to adapt function shapes and compose argument-driven transformations.
Functional Programming in Scala, Second Edition
Currying is the transformation of a function taking multiple arguments into a sequence of functions each taking one argument.
- How it is used
- Uses function transformation to expose partial application and motivate higher-order functions.
- How deep it goes
- Explains the type shape and relates it to partial application, while leaving implementation as an exercise.
- Examples
- Uses a two-argument Scala function, a partially applied function, and a carrot-for-apple-and-banana analogy.
- What you can do after
- Practice implementing curry and uncurry from their Scala type signatures.
Read how Functional Programming in Scala, Second Edition explains currying →
Acing the Frontend Interview
Currying transforms a function that accepts multiple arguments into a sequence of functions that each accept one argument.
- How it is used
- Deploys currying as an interview-relevant functional-programming technique and applied skill.
- How deep it goes
- Defines currying and demonstrates one reusable multiplier, while deferring broader performance optimization to advanced functional pipelines.
- Examples
- Uses curried multiplication, a reusable double function, and a logging wrapper as concrete JavaScript examples.
- What you can do after
- Build it from scratch by converting a multi-argument function into reusable single-argument functions.
F# in Action: A Revised Edition of Get Programming with F#
A curried function is a function represented as a sequence of single-argument functions, allowing arguments to be supplied incrementally.
- How it is used
- Uses single-argument functions to inject stable values early and supply remaining values later.
- How deep it goes
- Explains staged application, signatures, partial application, and practical benefits without descending into formal functional-programming theory.
- Examples
- Demonstrates arithmetic specialization with addFive and domain modeling with a reusable email sender.
- What you can do after
- Apply it via F# to create reusable specialized functions and call multi-argument functions incrementally or all at once.
Read how F# in Action: A Revised Edition of Get Programming with F# explains currying →
The Well-Grounded Rubyist, Fourth Edition
Currying is a functional programming technique that transforms a function of multiple arguments into a sequence of functions that can be evaluated incrementally.
- How it is used
- Creates reusable functions by supplying some arguments now and delaying the remaining computation until later.
- How deep it goes
- Explains arity, staged calls, partial application, and mixed argument groups, while stopping short of implementation internals.
- Examples
- Demonstrates addition, staged three-argument calls, variadic summation, method currying, and reusable array filtering.
- What you can do after
- Apply Ruby's curry method to build specialized functions from general Procs, lambdas, or methods.
Read how The Well-Grounded Rubyist, Fourth Edition explains currying →
The Coder Cafe
Currying is the transformation of a function taking multiple arguments into a sequence of functions that each take one argument.
- How it is used
- Uses function reshaping to support composition and reusable partial applications.
- How deep it goes
- Defines the transformation, demonstrates sequential calls, and stops short of implementation mechanics.
- Examples
- Demonstrates curried addition, sequential calls, and fixing 5 to create addFive.
- What you can do after
- Apply currying to create readable specialized functions and chain multi-argument calls.
Clojure: The Essential Reference
Currying is the transformation of a function of multiple arguments into a chain of functions that each accept a single argument.
- How it is used
- Clarifies how deferred arguments support composable function APIs in Clojure.
- How deep it goes
- Defines nested invocation, contrasts partial application, and stops short of compiler-level currying implementation.
- Examples
- Uses equivalent four-argument addition functions with progressively nested single-argument returns.
- What you can do after
- Apply currying by expressing multi-argument calls as nested single-argument functions, or choose partial for idiomatic Clojure composition.
Read how Clojure: The Essential Reference explains currying →
Also covered in
- Akka in Action, Second Edition
- Write Powerful Rust Macros
- Advanced Algorithms and Data Structures
- Fabulous Adventures in Data Structures and Algorithms
- Idiomatic Rust
- React Quickly, Second Edition
What to know first
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- functional programmingFunctional programming is a programming paradigm that expresses computation through the evaluation and composition of functions, typically favoring immutable data and minimizing mutable state and side effects.
- compositionComposition is the construction of a larger behavior, computation, or system by combining smaller functions, components, or operations.
- contextContext is the relevant information, state, or circumstances surrounding an input, decision, or activity that influence its interpretation or behavior.
Related concepts
- higher-order functioncontrasts with · A higher-order function is a function that accepts functions as arguments, returns functions as results, or both.
- partial applicationuses · Partial application is the creation of a function by fixing some arguments of another function, leaving the remaining arguments to be supplied later.
- functionuses · A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- event handler generatorimplements · An event handler generator is a function that returns an event handler when invoked with configuration or event-specific arguments.
- functional programmingkind of · Functional programming is a programming paradigm that expresses computation through the evaluation and composition of functions, typically favoring immutable data and minimizing mutable state and side effects.
Questions about currying
What is currying?
Currying is the transformation of a function that accepts multiple arguments into a sequence of functions that accept arguments incrementally, typically one at a time.
Which Manning books explain currying?
The Joy of JavaScript, Functional Programming in JavaScript, Functional Programming in C#, Second Edition, Learn Haskell by Example, Functional Programming in Scala, Second Edition, Acing the Frontend Interview, F# in Action: A Revised Edition of Get Programming with F#, The Well-Grounded Rubyist, Fourth Edition and 2 more.
What should I know before learning currying?
Manning books that teach currying usually introduce function, functional programming, composition and context first.
What is the difference between currying and higher-order function?
Currying is the transformation of a function that accepts multiple arguments into a sequence of functions that accept arguments incrementally, typically one at a time. A higher-order function is a function that accepts functions as arguments, returns functions as results, or both.
What is currying a kind of?
Currying is a kind of functional programming. Functional programming is a programming paradigm that expresses computation through the evaluation and composition of functions, typically favoring immutable data and minimizing mutable state and side effects.
What is currying also called?
Currying is also called curry or curried.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.









