Master Advanced Currying — Compose Curried Functions and Handle Edge Cases (Part 5)

The final chapter of the currying series: implement curry() that correctly handles functions with rest parameters (...args), composes two curried functions together (curry(f)(curry(g))), and supports un-currying (converting a curried function back to a regular multi-argument one). Also explore auto-curry using Proxy to intercept calls without knowing the arity upfront. This deep-dives into JavaScript metaprogramming and is a Staff-level FP question.

Examples
Input: []
Output:
Hints

Master Advanced Currying — Compose Curried Functions and Handle Edge Cases (Part 5)

The final chapter of the currying series: implement curry() that correctly handles functions with rest parameters (...args), composes two curried functions together (curry(f)(curry(g))), and supports un-currying (converting a curried function back to a regular multi-argument one). Also explore auto-curry using Proxy to intercept calls without knowing the arity upfront. This deep-dives into JavaScript metaprogramming and is a Staff-level FP question.