#4429: Ability to specify the namespace in mkName
---------------------------------+------------------------------------------
Reporter: reinerp | Owner:
Type: feature request | Status: new
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):
Would you perhaps consider adding some way to recover from failed lookups?
For instance, by returning a {{{Maybe}}}:
{{{
lookupName :: TH.NameSpace -> String -> Q (Maybe Name)
}}}
or alternatively somehow via {{{qRecover}}}?
The reason I ask this is that it should be possible for ordinary Template
Haskell users to implement the "totally fresh" semantics I was looking for
in #5375 using {{{lookupName}}}, as follows:
* generate a long string at random
* look it up with {{{lookupName}}}. If the lookup fails, then we have a
fresh name, otherwise loop.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4429#comment:6>
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