RE: mkName and qualified names

"Simon Peyton-Jones" <[email protected]>
Newsgroups gmane.comp.lang.haskell.template
Message-ID <4B93206CA3C55D4F96A61C9B1DC80DE3FFEC90@EUR-MSG-03.europe.corp.microsoft.com>
Ah, indeed so.  Apologies.

The constructor Var is actually called VarE.

And "dyn" should be defined but isn't.  I was wrong to say the mkName
won't do the job -- it will.  But as you found, it doesn't work for
qualified names.  It probably should.  (Or maybe "dyn" should but mkName
should not, because dyn is only used for *occurrences* whereas mkName
makes a name that you can use for binding too.  It wouldn't make sense
to say 
	let n = mkName "A.x" in LamE (VarP n) (VarE n)
)

So that's something I should fix.  But meanwhile, the unqualified
version works just fine
	mkTyConApp2 = $( varE . mkName $ "mkTyConApp" )

Simon

| -----Original Message-----
| From: George Russell [mailto:[email protected]]
| Sent: 01 April 2004 16:03
| To: George Russell
| Cc: Simon Peyton-Jones
| Subject: Re: mkName and qualified names
| 
| George Russell wrote:
| > Simon Peyton-Jones wrote:
| >
| >> If you read "Notes about TH v2" you'll see that if you want
something
| >> that is *not* lexically scoped, you can use
| >> $(dyn "x")
| >> inside quotes.  Section 4.4 dicssusses
| >
| >
| > "dyn" doesn't seem to be exported by Language.Haskell.TH in the HEAD
| > version.
| 
| ...
| 
| and while "Notes about TH v2" defines "dyn s = return (Var (mkName
s))",
| I can't do that because Language.Haskell.TH in the HEAD version
doesn't
| export Var either.  I did use "varE" in my original example.
| 
| best wishes,
| 
| George
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.