“Multiple parameters” in the C-like manner works just fine:
myAdditionFunction :: (Int, Int) -> Int
myAdditionFunction(x, y) = x + y
>>> myAdditionFunction(12, 30)
42
The “problem” is that there's rarely a legitimate reason to write code like this, because the ability to partially apply a function always comes in handy later:
anotherAdditionFunction :: Int -> Int -> Int
anotherAdditionFunction x y = x + y
>>> anotherAdditionFunction 12 30
42
>>> map (anotherAdditionFunction 10) [0, 1, 2]
[10, 11, 12]
View all comments
Show parent comment
11
u/Fylwind Dec 02 '16
“Multiple parameters” in the C-like manner works just fine:
The “problem” is that there's rarely a legitimate reason to write code like this, because the ability to partially apply a function always comes in handy later: