Opened 6 years ago

Closed 6 years ago

#8654 closed bug (duplicate)

Exponential-long compilation of code with Implicit params

Reported by: akamaus Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.2
Keywords: ImplicitParams slowness Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

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.

Change History (1)

comment:1 Changed 6 years ago by monoidal

Resolution: duplicate
Status: newclosed

See #8474. It's fixed in the development branch (which will become 7.8).

Note: See TracTickets for help on using tickets.