February 2019
Beginner to intermediate
180 pages
4h 4m
English
Due to JavaScript's dynamic nature, BuckleScript cannot always optimize the compiled output to remove the intermediate functions. However, you can tell BuckleScript to uncurry a function using the following syntax:
let add = (. a, b) => a + b;
The uncurry syntax is the dot in the argument list. It needs to be present at both the declaration and call sites:
let result = add(. 2, 3); /* 5 */
BuckleScript will throw a compile time error if the call site isn't using the uncurry syntax:
let result = add(2, 3);We've found a bug for you!This is an uncurried BuckleScript function. It must be applied with a dot.Like this: foo(. a, b)Not like this: foo(a, b)
Also, a compile time error is thrown if some of the function's arguments ...
Read now
Unlock full access