#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 simonpj):
I'm about to commit a patch implementing this change. In the end I did
not give a `NameSpace` argument because `NameSpace` is currently an opaque
type. Really what we want is just to say "type namspace" or "value
namespace", so I ended up with two functions
{{{
lookupTypeName :: String -> Q (Maybe Name)
lookupValueName :: String -> Q (Maybe Name)
}}}
Both end up mapping to the same method of the `Quasi` class
{{{
class Quasi m where
...
lookupName :: Bool -> String -> m (Maybe Name)
...
}}}
The `Bool` is `True` for the type namespace, and `False` for values. Not
beautiful, but most users will use the `lookupTypeName` and
`lookupValueName` interfaces.
Any objections yell now!
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4429#comment:8>
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