|
|
|
|
|
by markslicker
2443 days ago
|
|
In functional programming (the origin of this syntax), add(a: int, b: int): int
can be read as a function 'add' when applied to the parameter tuple (a: int, b: int) has type int, I believe Ocaml, SML, actually support this syntax, whereas '->' (arrow) is a function type constructor in functional programming with 'A -> B' denoting a function from A to B. The type of add by itself in a language like Haskell would be:add :: (int, int) -> int |
|
These languages "emulate" multiple arguments through partial function application. OCaml does not use tuples for arguments.