[GHC] #10853: Refine addTopDecls
GHC
ghc-devs at haskell.org
Mon Sep 21 01:41:50 UTC 2015
#10853: Refine addTopDecls
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.1
Component: Template Haskell | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by osa1):
Sorry if this is completely unrelated, but I realized this weird behavior
while implementing #10891. Let's say I have this:
{{{#!haskell
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Language.Haskell.TH
import System.IO
data D = A Int | B Bool
test = $(... reify ''D ...)
main :: IO ()
main = return ()
}}}
This fails with:
{{{
Main.hs:11:5:
‘D’ is not in the type environment at a reify
}}}
But if I add this line between the splice and `D`:
{{{
$(return [])
}}}
Suddenly it works.
I couldn't find anything about regions in the wiki, but how do we split
this program into regions and how do we explain this seemingly weird
behavior? It seems like we can improve the way we evaluate TH splices.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10853#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list