Skip to content

Instantly share code, notes, and snippets.

@philderbeast
Last active August 29, 2015 14: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 philderbeast/fbf5279bc24d79534728 to your computer and use it in GitHub Desktop.
Save philderbeast/fbf5279bc24d79534728 to your computer and use it in GitHub Desktop.
F# function arguments and parens style.
// A difference of F# to C# is tupled versus curried function arguments.
// I suggest this F# function application style;
// * Separate functions from their arguments with a space.
// * Only use parens with tuples or when adding type annotations to curried args.
let f x = x
let add x y = x + y
let add' (x, y) = x + y
let y = f 1 // not f(1)
let five = add 2 3 // or with a redundant type annotation add (2 : int) 3
let five' = add' (2, 3) // not add'(2, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment