#4429: Ability to specify the namespace in mkName
---------------------------------+------------------------------------------
Reporter: reinerp | Owner:
Type: feature request | Status: infoneeded
Priority: normal | Milestone: 7.4.1
Component: Template Haskell | Version: 6.12.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by reinerp):
I've attached a patch with regression tests for this and #5406.
I'd appreciate it if you had a look at the shadowing tests in
{{{TH_lookupName.hs}}}. I'm not sure if the current behaviour is correct.
My specific question is what should this do:
{{{
{-# LANGUAGE TemplateHaskell #-}
import Language.Haskell.TH
f = "global"
main = print [
$( [| let f = "local" in $(do { Just n <- lookupValueName "f"; varE n })
|] ),
$( [| let f = "local" in $(varE 'f) |] ),
let f = "local" in $(do {Just n <- lookupValueName "f"; varE n }),
let f = "local" in $(varE 'f)
]
}}}
This currently prints {{{["global","local","local","local"]}}}. Should the
first two really give different results?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4429#comment:14>
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