#5463: SPECIALISE pragmas generated from Template Haskell are ignored
---------------------------------+------------------------------------------
Reporter: NickSmallbone | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Template Haskell | Version: 7.2.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by NickSmallbone):
Aha, that explains it! I imagined that GHC, on encountering a splice,
would typecheck everything up to that splice but would do all the code
generation and so on after expanding the splices.
In reality my specialise function looks at the type of the function it's
specialising, so I can't use your workaround. I would like to be able to
write
{{{
three :: Monad m => m Int
$(specialise 'three)
three = return 3
}}}
but GHC of course complains that there is no definition for three, because
the splice separates the definition from the type signature.
Anyway, I can easily live without this. It means that I lose some
performance in a program I've written, but in my case the generated code
is very respectable even without any SPECIALISE pragmas.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5463#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs