Re: monomorphism/hugs98/ghc-5.02.3
Thanks a lot for the solution! And of course the ghci behaviour is much more sensible than the hugs one. And for pointing me to the mail archive. It encourages me to submit my next problem: stack overflow with simple Show instances...more later I wonder if there is a list of Hugs to GHCI "gotchas"? Matt. --------------------------------------------------------------------------- Matt Fairtlough m.fairtlough@dcs.shef.ac.uk Verification and Testing Group Room 115 Department of Computer Science University of Sheffield Regent Court, 211 Portobello Street Sheffield S1 4DP Tel: (0)114-22-21826 UK Fax: (0)114-22-21810 WWW: http://www.dcs.shef.ac.uk/~matt/ ----------------------------------------------------------------------------
It encourages me to submit my next problem: stack overflow with simple Show instances...more later
Let me guess that this involves a data declaration of the form: data Foo = ... | Foo <op> ... | ... That is an infix data constructor whose first argument is a recursive reference to the datatype. This will throw the parser into an infinite loop - the usual problem of recursive descent parsers and left recursive grammars. (If anyone is keeping a list of things to fix in Haskell 2, this should be on the list. Seems that this oversight is almost as embarrassing as Bell Labs (home of Aho, Sethi and Ullmann) designing a language (C) which is not context free (because of the typedef problem).) -- Alastair Reid
This is actually no longer an issue, as H98's behaviour
for derived Show and Read instances have changed
recently.
When Simon next has the time (and inclination) to put out
a Report revision, text describing the change will be
included. In the meantime, have a look at
static.c:mkReadInfix() and static.c:showsPrecRhs() in
the current Hugs98 sources for details of the tweaks made.
--sigbjorn
----- Original Message -----
From: "Alastair Reid"
It encourages me to submit my next problem: stack overflow with simple Show instances...more later
Let me guess that this involves a data declaration of the form:
data Foo = ... | Foo <op> ... | ...
That is an infix data constructor whose first argument is a recursive reference to the datatype.
This will throw the parser into an infinite loop - the usual problem of recursive descent parsers and left recursive grammars.
(If anyone is keeping a list of things to fix in Haskell 2, this should be on the list. Seems that this oversight is almost as embarrassing as Bell Labs (home of Aho, Sethi and Ullmann) designing a language (C) which is not context free (because of the typedef problem).)
-- Alastair Reid _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (3)
-
Alastair Reid -
Matt Fairtlough -
Sigbjorn Finne