Skip to content

Instantly share code, notes, and snippets.

@ninjarobot
Created August 11, 2017 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninjarobot/30674d31121105bfb0126904e57689af to your computer and use it in GitHub Desktop.
Save ninjarobot/30674d31121105bfb0126904e57689af to your computer and use it in GitHub Desktop.
F# currying example
let add2 num1 num2 =
num1 + num2
// The compiler will do this:
let addTwo num1 =
fun num2 ->
num1 + num2
// Both functions work the same, but the curried form accepts a single parameter and returns a function that accepts another parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment