[GHC] #8654: Exponential-long compilation of code with Implicit params

GHC ghc-devs at haskell.org
Mon Jan 6 14:43:43 UTC 2014


#8654: Exponential-long compilation of code with Implicit params
-------------------------------------+-------------------------------------
       Reporter:  akamaus            |             Owner:
           Type:  bug                |            Status:  new
       Priority:  normal             |         Milestone:
      Component:  Compiler           |           Version:  7.6.2
       Keywords:  ImplicitParams     |  Operating System:  Unknown/Multiple
  slowness                           |   Type of failure:  Compile-time
   Architecture:  Unknown/Multiple   |  performance bug
     Difficulty:  Unknown            |         Test Case:
     Blocked By:                     |          Blocking:
Related Tickets:                     |
-------------------------------------+-------------------------------------
 Some time ago I stumbled upon GHC hanging on my code. After some
 experiments I managed to minify it to:

 {-# LANGUAGE ImplicitParams #-}

 data D = D Int deriving Show

 slow_to_compile :: IO ()
 slow_to_compile = do
   tst1 <- return 1

   let ?tst1 = tst1
   let ?tst2 = tst1
   let ?tst3 = tst1
   let ?tst4 = tst1
   let ?tst5 = tst1
   let ?tst6 = tst1
   let ?tst7 = tst1

   print $ D ?tst1

 It compiles, but takes a while. Every additional binding doubles
 compilation time.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8654>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list