Advertisement
Guest User

Untitled

a guest
May 25th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. // A difference of F# to C# is tupled versus curried function arguments.
  2. // I suggest this F# function application style;
  3. // * Separate functions from their arguments with a space.
  4. // * Only use parens with tuples or when adding type annotations to curried args.
  5.  
  6. let f x = x
  7. let add x y = x + y
  8. let add' (x, y) = x + y
  9.  
  10. let y = f 1 // not f(1)
  11. let five = add 2 3 // or with a redundant type annotation add (2 : int) 3
  12. let five' = add' (2, 3) // not add'(2, 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement