-
-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Labels
Description
The partial operator allows you to partially apply a function.
For example, look at this implementation of an add function:
let add = (a, b) => a + b
In let add2 = partial add(2), add2 is a function that accepts a single argument and adds two to it.
Arguments may also be skipped and provided later:
let map123 = partial List.map(_, [1, 2, 3])
map123(a => a * 4) // [4, 8, 12]