Presumably @~ is an undefined operator, but haskell tries to resolve the type of foo before resolving the type of @~. -Alex- On Wed, 25 Aug 1999, Keith Wansbrough wrote: > 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] : > :---------------------------------------------------------------------: > > ___________________________________________________________________ S. Alexander Jacobson Shop.Com 1-212-697-0184 voice The Easiest Way To Shop
Re: As- and irrefutable- patterns
S. Alexander Jacobson Wed, 25 Aug 1999 13:20:18 -0400 (Eastern Daylight Time)
- As- and irrefutable- patterns Keith Wansbrough
- Re: As- and irrefutable- patterns S. Alexander Jacobson
- Re: As- and irrefutable- patterns Fergus Henderson