#5375: Regression in newName
---------------------------------+------------------------------------------
Reporter: reinerp | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Template Haskell | Version: 7.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC rejects valid program
---------------------------------+------------------------------------------
Comment(by simonpj):
Indeed. And the classic example from every meta-programming paper: look
at `gen` in Section 2 of [http://research.microsoft.com/en-
us/um/people/simonpj/papers/meta-haskell/meta-haskell.pdf the original TH
paper]. We write things like
{{{
f v = ... [| \x -> ...$(f [| x |])... |] ...
}}}
and the 'x' passed to `f` (insde the quote) must be indissolubly linked to
the 'x' created by the lambda. Note that the invocation of `f` inside the
quote may itself make a new `\x` and so on (this happens in `gen`). These
lambdas must create fresh names; hence `newName`.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5375#comment:4>
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