|    In my memory this bug has already been reported, but it is not
| mentioned in the hugs-bugs-list, so
| here goes:
| 
| The next pattern binding is accepted with no error in Hugs and is
| equivalent to: f = 3
| 
| f = 3
| f = 4
| 
| This both in   Hugs 1.4  (June 1998)
|            and           (981112 BETA)

Short answer: the as yet unreleased Hugs 98 does what the Haskell 98
report says it should.

Long answer (cribbed from what I wrote last time this question was
asked):  You are right that Hugs currently differs from the Haskell
report in this respect.  The justification for this difference is
that you can think of a simple variable as being the trivial form of
a function binding --- a function without arguments.  So it is the
following analogy that motivates what Hugs does:

  If   let { f x = ...; f x = ... } in ... is legal,
  then let { f = ...; f = ... } in ... should also be legal.

In fact this decision goes back all the way to the original version
Gofer.  But, in the interests of closer compatibility with Haskell,
Hugs 98 does instead what the Haskell report suggests.

All the best,
Mark


Reply via email to