#5375: Regression in newName
---------------------------------+------------------------------------------
Reporter: reinerp | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 7.2.1
Component: Template Haskell | Version: 7.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC rejects valid program
---------------------------------+------------------------------------------
Comment(by reinerp):
Okay, consider the interpolated-string quasiquoter from before. Given:
{{{
f x = [qc|The value is { (x, let x = 3 in x) } |]
}}}
I would like to produce:
{{{
f x = let theString = "The value is "
in theString ++ show (x, let x' = 3 in x')
}}}
It seems that I need to use {{{lookupName}}} for the {{{x}}} in the
{{{fst}}} of the tuple (to make sure that it doesn't get captured by the
{{{theString}}} binding, for example), and I need to use {{{mkName}}} for
the occurrences of {{{x}}} in the {{{snd}}} of the tuple.
This is possible to do, certainly, but it means my quasiquoter has keep in
mind the scoping rules of Haskell. Or is there a simpler way?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5375#comment:12>
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