Hi George,

I believe that punning was taken out of Haskell 98 because of some (IMO,
mistaken) concerns about renaming.  If memory serves me, somebody
had complained that punning `broke alpha-renaming'.  For example, you
can't treat (\x -> C{x}) as being equivalent to (\y -> C{y}) ... which
all seems perfectly reasonable to me, and in just the same way that you
wouldn't want (\x -> "x") to be treated as being equivalent to (\y -> "y").
The correct renaming of (\x -> C{x}) is, of course, (\y -> C{x=y}).

So I think it was a mistake to remove punning.  But that was what the
Haskell committee decided, so Hugs 98 doesn't allow punning in Haskell 98
mode.  It will, however, support punning in extended mode (run with the -98
flag).

Hope that helps!

Mark


Reply via email to