Re: As- and irrefutable- patterns

1999-08-26 Thread Fergus Henderson
On 25-Aug-1999, Keith Wansbrough <[EMAIL PROTECTED]> 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) >

As- and irrefutable- patterns

1999-08-25 Thread Keith Wansbrough
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" (li

Re: As- and irrefutable- patterns

1999-08-25 Thread S. Alexander Jacobson
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 >