
#9701: GADTs not specialized properly -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Runtime | Blocked By: performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by ekmett): Reid Barton mentioned a fairly simple scheme of skimming the core looking for terms of type `C T` where you have an `instance C T` declaration in scope with no context, and replacing those terms with the dictionary for the witness. That could make cases like `Set`-carrying-a-dictionary-for-`Ord` optimizable for known instances. It'd be the most specific match, should win for `IncoherentInstances`, doesn't collide with the `(?x :: Int)` case. The trick then is selling an optimization for a style of code that currently doesn't get written. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9701#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler