Skip to content

Instantly share code, notes, and snippets.

@IwanKaramazow
Last active March 15, 2018 04:27
Show Gist options
  • Save IwanKaramazow/e6f885e07a4cb700e63ba48a9bcdca49 to your computer and use it in GitHub Desktop.
Save IwanKaramazow/e6f885e07a4cb700e63ba48a9bcdca49 to your computer and use it in GitHub Desktop.
Uncurried syntax
/* uncurried function definition */
let add = [@bs] (a, b) => a + b;
/* uncurried function application */
let two = [@bs] add(1, 2);
/* uncurried callbacks === inline uncurried function definition */
setTimeout([@bs] () => Js.log("test"), 1000);
/* uncurried function definition */
let add = (. a, b) => a + b;
/* uncurried function application */
let two = add(. 1, 2);
/* uncurried callbacks === inline uncurried function definition */
setTimeout((.) => Js.log("test"), 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment