[Haskell-cafe] Function Precedence
PR Stanley
prstanley at ntlworld.com
Tue Apr 1 16:31:29 EDT 2008
>Think about this:
>
>map (+1) [1..10]
>
>What should it do?
> take (+1) and return a function which takes a list as its
> argument and finally return a list.
>How about:
>
>f 1 2 3
>
>Should that be f (1 (2 3)), or ((f 1) 2) 3?
The latter, of course, but that's not really what I'm
driving at. I'm asking why we can't have a function treated
differently with regard to the precedence and associativity rules. f
1 2 is indeed ((f 1) 2). Why not f 1 g 2 == ((f 1) (g 2))?
Cheers, Paul
More information about the Haskell-Cafe
mailing list