It's an embarassing fact that you can make GHC's simplifier
loop using fixpoint data types in the way you do.  This is mentioned
in the 'Secrets of the GHC inliner' paper.   It's fixable, but
it's nuisance to fix, and would slightly slow up the compilation
of all programs, so we've never done it.  I havn't confirmed
for sure that this is what is happening to you, but I'm 
90% certain.

(Reason: GHC keeps inlining under control by not inlining
recursive functions -- but no functions here are recursive...)

Simon

| -----Original Message-----
| From: [EMAIL PROTECTED] 
| [mailto:[EMAIL PROTECTED]] 
| Sent: 02 August 2001 21:22
| To: [EMAIL PROTECTED]
| Subject: Re: GHC 5.00 problem compiling Y Combinator 
| 
| 
| 
| Micahel Weber writes:
| > I am pretty much sure that we have a Debian package for 5.00.2 :)
| > 
| >     http://packages.debian.org/unstable/devel/ghc5.html
| 
| okay, tried again with the 5.00.2 package; same behavior:
| 
|     Glasgow Haskell Compiler, Version 5.00.2, for Haskell 98, 
| compiled by GHC version 5.00.2
|     Using package config file: /usr/lib/ghc-5.00.2/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/ghc6092.hspp && cat 
| Y.hs >> /tmp/ghc6092.hspp
| 
|     *** Checking old interface for hs = Just "Y.hs", hspp = 
| Just "/tmp/ghc6092.hspp":
|     Compiling Y                ( Y.hs, Y.o )
|     *** Parser:
|     *** Renamer:
|     *** Typechecker:
|     *** Desugar:
|         Result size = 76
|     *** Simplify:
|     Removing: /tmp/ghc6092.hspp
| 
| It gets stuck just after it prints "*** Simplify:" and 
| consumes all available memory until I hit Ctrl-C.
| 
| The file, again, is the following:
| 
| ---begin Y.hs---
| module Y
| (y, fact, factorial)
| 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---
| 
| -- 
| aleksey
| 
| _______________________________________________
| Glasgow-haskell-bugs mailing list 
| [EMAIL PROTECTED] 
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-bugs
| 

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to