On Mon, Aug 16, 1999 at 16:40:30 -0500, Michael Hobbs wrote:
> 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)

*hmm* at least hugs also complains:
ERROR "recs.hs" (line 2): Haskell 98 does not support missing field bindings

But you can also do:
\begin{code}
abs (Pt pointx pointy) = sqrt (pointx*pointx + pointy*pointy)
\end{code}
if you don't want to mention field names...


Cheers,
Michael
-- 
Today, signature's out...

Reply via email to