According to the Haskell 98 report, patterns have the following grammar:

apat ::= var [ @ apat ]
      |  ~ apat
      | ...etc...

Thus the following program should be legal (IMHO):

main = let foo@~(x,y) = (1,2)
       in  print foo

Instead, both Hugs and GHC report

  ERROR "TestAsPat.hs" (line 1): Undefined variable "foo"

What have I missed?

Replacing the lhs with foo@(~(x,y)) works, BTW.

Thanks..

--KW 8-)


-- 
: Keith Wansbrough, MSc, BSc(Hons) (Auckland) ------------------------:
: PhD Student, Computer Laboratory, University of Cambridge, England. :
:  (and recently of the University of Glasgow, Scotland. [><] )       :
: Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.    :
: http://www.cl.cam.ac.uk/users/kw217/  mailto:[EMAIL PROTECTED]     :
:---------------------------------------------------------------------:




Reply via email to