The definition of lhsfun in the report
Frank Atanassow
franka@cs.uu.nl
Thu, 10 May 2001 13:12:30 +0200
> I'am confused about the "funlhs" production, in "Report on the programming
> Language Haskell 98" of the 1st February 1999.
>
> In the report one of the "funlhs"-productions is (see page 127):
>
> funlhs -> var apat {apat}
>
> That is a <var> followed by one to many <apat>. But you can have functions
> like this:
>
> fun :: Int
> fun = 17
This does not declare a function. If you look at the decl production, you
will see that there is another possibility, namely pat^0, which provides
this syntax.
OTOH it is possible to declare a function using pat, e.g.:
fun = \x -> x+1
In other words, funlhs is redundant.
---
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508TB Utrecht, The Netherlands
Tel +31 (0)30 253-3261 Fax +31 (0)30 251-3791