
Thanks so much for looking into this. I maybe wasn't clear in the body
#13873: Adding a SPECIALIZE at a callsite in Main.hs is causing a regression -------------------------------------+------------------------------------- Reporter: jberryman | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: Specialise Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Replying to [comment:4 jberryman]: that the reason I filed the ticket was I assumed that GHC would try to choose the best specialization from those in scope (since my intuition was specialize pragmas behave sort of like type classes in the way they leak via `import` statements) and from whatever specializations it might perform in context.
But maybe this is expected behavior, and a manual specialization will
always take precedence? The specialiser doesn't choose which specialisation to apply, it merely looks for specialisation opportunities and then creates a new definition along with a RULE which does the replacement. If you have conflicting specialisations then the choice about which one applies is left up to he rule selection mechanism which I am not as familiar with. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13873#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler