[Haskell-cafe] Function Precedence

Janis Voigtlaender voigt at tcs.inf.tu-dresden.de
Tue Apr 1 06:48:20 EDT 2008


PR Stanley wrote:
> Hi
> If
> f x = x
> and
> g y = y
> then
> f g x
> returns an error because f takes only one argument. Why can't we have 
> function application implemented outwardly (inside-out).

Why should it be so?

> So
> f g x would be applied with
> gx first followed by its return value passed to f instead of putting g x 
> in brackets.

You can get the same behavior with

  f . g $ x

if you mislike brackets.

-- 
Dr. Janis Voigtlaender
http://wwwtcs.inf.tu-dresden.de/~voigt/
mailto:voigt at tcs.inf.tu-dresden.de


More information about the Haskell-Cafe mailing list