"Punning" was removed (in my view this was a mistake) in Haskell 98.
That's why neither GHC nor Hugs accepts it.
Simon
> -----Original Message-----
> From: Michael Hobbs
> Sent: Monday, August 16, 1999 10:41 PM
> Cc: [EMAIL PROTECTED]
> Subject: Field label bug?
>
>
> Is this a bug with ghc-4.04 or just a "feature" of Haskell 98
> that I was
> unaware of? I get a parse error with the following code:
>
> data Point = Pt {pointx, pointy :: Float}
> abs (Pt {pointx, pointy}) = sqrt (pointx*pointx + pointy*pointy)
>
> It doesn't like the `,' on the second line. If I change it to:
>
> abs (Pt {pointx=pointx, pointy=pointy}) = sqrt (pointx*pointx +
> pointy*pointy)
>
> It compiles fine.
> This is on Solaris 2.5, in case it matters.
>
> - Michael Hobbs
>