Skip to content

ghc "Simplifier ticks exhausted" "When trying UnfoldingDone"

ghc fail to compile this file:

---- begin Y.hs ----
newtype Rec a = Rec { unRec :: Rec a -> a }

y :: (a -> a) -> a
y = \f -> (\x -> f (unRec x x)) (Rec (\x -> f (unRec x x)))

foo :: (a -> a) -> a -> a
foo f n = f n

main = print $ y foo 4
---- end Y.hs ----

Try it:

C:\Users\user\Desktop>ghc Y.lhs
[1 of 1] Compiling Main             ( Y.lhs, Y.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for i386-unknown-mingw32):
        Simplifier ticks exhausted
    When trying UnfoldingDone a_sqe{v} [lid]
    To increase the limit, use -fsimpl-tick-factor=N (default 100)
    If you need to do this, let GHC HQ know, and what factor you needed
    To see detailed counts use -ddump-simpl-stats
    Total ticks: 5601
Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information