[Haskell-cafe] Re: Function Precedence

Loup Vaillant loup.vaillant at gmail.com
Wed Apr 2 16:13:28 EDT 2008


2008/4/2, Dan Piponi <dpiponi at gmail.com>:
> On Tue, Apr 1, 2008 at 2:07 PM, PR Stanley <prstanley at ntlworld.com> wrote:
>  >  All you'd have to do is to give the inner most function the highest
>  > precdence
>
>
> What's the innermost function in "f g x" here?
>
>  test :: (a -> b -> c) -> a -> b -> c
>  test f g x = f g x

g (if I followed correctly). But we have a problem:

If I want f g x to be parsed as f (g x), I would probably want,
f g x y to be parsed as f (g x y), considering g as the innermost
function, again.

I'm almost certain that it would render type inference impossible, and
maybe partial application as well. (id 4 is a total application, but
id (\x -> x+1) is a partial one...)

The only choices left are right associativity or left associativity.

Loup


More information about the Haskell-Cafe mailing list