The original 5.00 contained a large number of bugs, including
at least one typechecker-infinite-loop one. I strongly suggest
you move to 5.00.2 which is very much more stable, and
try again. I don't think we have a Debian package for 5.00.2,
but you can get a vanilla Linux executable bundle (.tar.gz)
from www.haskell.org/ghc, which will probably work ok for you.
J
| -----Original Message-----
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
| Sent: Thursday, August 02, 2001 1:20 AM
| To: [EMAIL PROTECTED]
| Subject: GHC 5.00 problem compiling Y Combinator
|
|
|
| Hi,
| I am running GHC 5.00 on an i586-linux machine (up-to-date
| Debian "woody" distribution -- the GHC package is
| ghc5_5.00-1_i386.deb). The machine has 64 megs of RAM and 64
| meg swap.
|
| soyuz:~$gcc --version
| 2.95.4
| soyuz:~$ghc --version
| The Glorious Glasgow Haskell Compilation System, version 5.00
|
| Compiling the following file (Y.hs) produces the following
| output (before I Ctrl-C the process) and eats up all available memory:
|
| soyuz:~/haskell$ghc -v -C Y.hs
| Glasgow Haskell Compiler, Version 5.00, for Haskell 98,
| compiled by GHC version 5.00
| Using package config file: /usr/lib/ghc-5.00/package.conf
| Hsc static flags: -static -fignore-interface-pragmas
| -fomit-interface-pragmas -fdo-lambda-eta-expansion -flet-no-escape
| *** Ineffective C pre-processor
| echo '{-# LINE 1 "Y.hs" #-}' > /tmp/ghc5006.hspp && cat
| Y.hs >> /tmp/ghc5006.hspp
|
| *** Checking old interface for hs = Just "Y.hs", hspp =
| Just "/tmp/ghc5006.hspp":
| Compiling Y ( Y.hs, Y.o )
| *** Parser:
| *** Renamer:
| *** Typechecker:
| *** Desugar:
| Result size = 76
| *** Simplify:
| Removing: /tmp/ghc5006.hspp
|
| Same behavior (consumes all memory) also happens with GHC
| 4.08.1 February Hugs98 is able to load and interpret the file
| correctly.
|
| Obviously noone will write recursive functions in this
| manner; but the compiler's behavior nonetheless strikes me as
| a bit strange.
|
| Here is the file:
|
| ----begin Y.hs----
|
| module Y
| where
|
| data D a = D ((D a) -> a)
|
| unD :: D a -> D a -> a
| unD (D g) = g
|
| y :: ((a -> a) -> a -> a) -> a -> a
| y = \f -> let
| z = \g -> f ((unD g) g)
| in
| z (D z)
|
| fact :: (Integer -> Integer) -> Integer -> Integer
| fact = \factt -> \x -> if (x == 0) then 1 else x * (factt (x-1))
|
|
| factorial :: Integer -> Integer
| factorial = y fact
|
| ----end Y.hs----
|
| Thanks
| --
| aleksey
|
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/glasgo| w-haskell-bugs
|
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs