I'm puzzled by a bit of the Haskell 1.2 report on page 36; can anyone
clarify?

The BNF and the supprting text seem to disagree.

The BNF defines <lhs> as a <pat> or a <funlhs>, where <pat> cannot be a
successor pattern.  But <funlhs> can be a successor pattern, since "+" is a
<varop>.  So a successor pattern can only be parsed as a function binding,
ie as a redefinition of "+".  It can never be parsed as a pattern binding.

In the supporting text the sentence beginning, "Top level n+k pattern
bindings are explicitly disallowed" suggests that successor pattern
bindings _are_ allowed in contexts other than the top level (ie in "where"
or "let" constructs).  Is this the case?  If so, how is the ambiguity
resolved?  Should the sentence begin, "Successor pattern bindings are
explicitly disallowed?"

-Norman Paterson


Reply via email to