[Haskell-cafe] problem with boolean splicing in templates in ghc 6.10.1

Ian Lynagh igloo at earth.li
Wed Nov 12 10:25:13 EST 2008

On Tue, Nov 11, 2008 at 02:16:21PM -0600, Leonidas Fegaras wrote:
> Seems that boolean splicing in haskell templates in ghc 6.10.1 does not
> work correctly. If you do:
> $((\b -> [| b |]) True)
> you get the error:
> Can't find interface-file declaration for data constructor GHC.Base.True
>       Probable cause: bug in .hi-boot file, or inconsistent .hi file
>       Use -ddump-if-trace to get an idea of which file caused the error
> It seems that GHC.Base.True is now GHC.Bool.True, but the splicing code
> still generates the former.

Fixed in HEAD and 6.10 branch, and I've added a test to the testsuite.

If you want to build a fixed template-haskell package locally then the
fix is:

hunk ./Language/Haskell/TH/Syntax.hs 264
-trueName  = mkNameG DataName "base" "GHC.Base" "True"
-falseName = mkNameG DataName "base" "GHC.Base" "False"
+trueName  = mkNameG DataName "ghc-prim" "GHC.Bool" "True"
+falseName = mkNameG DataName "ghc-prim" "GHC.Bool" "False"


More information about the Haskell-Cafe mailing list