Curry

Published: 1/18/2020
Last edited: 1/26/2020

Currying is a way of modifying a given function which takes multiple arguments in to a sequence of unary functions.

Specifically, in JS, it means that you can manipulate arguments, their order, and other facets of a passed in function.

const manual = a => b => c => a + b / c
import {curry} from 'ramda'
const auto = curry((a, b, c) => a + b / c)
manual(1)(9)(2) === auto(1)(9)(2)
manual(1)(9)(2) === auto(1, 9)(2)
manual(1)(9)(2) === auto(1, 9, 2)
manual(1)(9)(2) === auto(1)(9, 2)

Modules

ramdalodashkatsu-curryfpo
Published: 1/18/2020
Last edited: 1/26/2020
See this page on Github
Built with 💛 by Open Sorcerers
Created with Gatsby using the 😎 foresight starter