GHC non-termination

Robert Dockins robdockins at fastmail.fm
Tue Sep 5 15:47:40 EDT 2006


Hello all,

I've discovered that GHC doesn't deal very well with the following  
program.  It appears to diverge when running the following program  
with 'runghc'.  The main compiler can also be persuaded to diverge in  
a similar fashion.  Hugs exhibits correct behavior, ie, it prints  
"hello".

This is with GHC 6.4.2.  I've tested on linux x86 and PPC OS X.



newtype Mu a = Roll { unroll :: Mu a -> a }

omega :: a
omega = (\x -> (unroll x) x) (Roll (\x -> (unroll x) x))

main = putStrLn "hello"



Rob Dockins

Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
           -- TMBG





More information about the Glasgow-haskell-users mailing list