On Tuesday, 24 September 2013 at 12:09:28 UTC, Szymon Gatner wrote:
On Tuesday, 24 September 2013 at 12:06:22 UTC, Max Samukha wrote:

A 'normal' function in Haskell takes exactly one object and returns exactly one object. a -> b -> c is actually a -> (b -> c) because -> is right-associative. It's perfectly readable for people in the Haskell subculture. You'll have hard time convincing them otherwise :)

Isn't function application in Haskell left-associative? (I might be confusing terms as I am just learning it)

So am I.

Function application is left-associative. (f a b) is the equivalent of ((f a) b).

Arrow in the lambda types is right-associative. If you mentally add parens, then things like (a -> b -> c) -> [a] -> [b] -> [c] look less intimidating - (a -> (b -> c)) -> ([a] -> ([b] -> [c])). Well, they don't. But at least you can make some sense of them, sometimes. They definitely don't look more intimidating than D's template instantiations.

Reply via email to