infinite loop in ghc5.04
Simon Peyton-Jones
simonpj at microsoft.com
Wed Sep 11 04:28:53 EDT 2002
Thanks for the report. It's a known bug in 5.04, will be fixed in
5.04.1 (which is imminent)
Simon
| -----Original Message-----
| From: Mark Tullsen [mailto:mtullsen at cse.ogi.edu]
| Sent: 10 September 2002 19:47
| To: glasgow-haskell-bugs at haskell.org
| Subject: infinite loop in ghc5.04
|
| When I attempt to compile the following code with ghc 5.04
|
| newtype Server i o = Server (i -> (o, Server i o))
|
| machine :: s -> ((i,s) -> (s,o)) -> Server i o
| machine init next = Server (f init)
| where
| f s i = (o, Server (f s'))
| where
| (s',o) = next (i,s)
|
| I get the following
|
| $ ghc -c T.hs
| stack overflow: use +RTS -K<size> to increase it
|
| $ ghc -c T.hs +RTS -K10m
| stack overflow: use +RTS -K<size> to increase it
|
| $ ghc -c T.hs +RTS -K20m
| stack overflow: use +RTS -K<size> to increase it
|
| ...
|
| But if I transform the program to the equivalent
|
| newtype Server i o = Server (i -> (o, Server i o))
|
| machine :: s -> ((i,s) -> (s,o)) -> Server i o
| machine init next = Server (f next init)
|
| f next s i = (o, Server (f next s'))
| where
| (s',o) = next (i,s)
|
| ghc compiles without a problem. Changing 'newtype' to 'data'
| also makes the problem go away. This is on a Linux (RH 7.3)
| machine with an i686 processor.
|
| Thanks.
|
| - Mark
|
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list