Curry with Placeholder

Hard
Code
Loading editor...
Tap Analyze to see visualization
Variables

Run code to see variables

Output

Console output will appear here

Press Space to start to step? all shortcuts

Solution Guide: Curry with Placeholder

Approach

Extend basic currying with a placeholder symbol that marks positions for deferred arguments. On each partial call, merge new arguments into placeholder positions from the previous call. Continue until all positions hold real values and the required arity is met.

Complexity Analysis

Time
O(n) per partial call for merging
Space
O(n) where n is the number of arguments

Pattern

Advanced Curry Pattern

Why It Works

The placeholder symbol acts as a sentinel value that can be detected and replaced during argument merging, allowing arguments to be supplied in any order across multiple partial applications.

Updated Mar 2026