Bartosz Milewski seems to like D more than C++ now :)

Max Samukha maxsamukha at gmail.com
Tue Sep 24 06:01:52 PDT 2013


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.


More information about the Digitalmars-d mailing list