3 ms·
Sentence 'Therefore, a programming language such as Haskell has only functions taking one argument.' is a little bit misleading. Haskell perfectly fine handles
by ubavic 4y ago
Sentence 'Therefore, a programming language such as Haskell has only functions taking one argument.' is a little bit misleading. Haskell perfectly fine handles multi-argument functions. It even has functions `curry` and `uncurry` in the Prelude.
- afiori 4y agoA tuple is still a single value f x has a single argument, even if x is (a, b)
- sudosysgen 4y agoNot really. A Haskell function takes a single argument. Currying works by partial application from left to right. f a b would then be equivalent to (f a) b such that (f a) evaluates to a new function which takes a single argument. 'curry' and 'uncurry' allow to go to and from this way of handling arguments instead of using tuples. But tuples are also a single value, and this is actually very important - you won't be able to change a single 'argument' without creating a new pair, for example. There is no way to have a real multi argument function.