RE: FW: TH restrictions

"Simon Peyton-Jones" <[email protected]>
Newsgroups gmane.comp.lang.haskell.template
Message-ID <036EAC76E7F5EC4996A3B3C3657D4116012C9C07@EUR-MSG-21.europe.corp.microsoft.com>
| >|     foo = and
| >|     bar = [| foo |]
| >|
| >| in one module used to be OK whereas now it gives
| >|
| >|     No instance for (Language.Haskell.TH.Syntax.Lift ([Bool] ->
Bool))
| >

I have just fixed this.

Kean asked:

| I came accross this one and thought it was a feature.  If this could
be
| fixed it would actually have more impact... one question though, what
| happens if:
| 
| [d| dec 1 |]
| [d| dec 2 |]
| 
| We refer to some thing spliced in "dec 1" inside the quasi-quotes of
| "dec 2"?

You'll have to give a more precise example. In my example, the
occurrence of 'foo' referred to a lexically-visible binding for foo.
You might need $(dyn "foo") in your example.  However, you can say

	$(furgle ...)
	x = [| foo |]
where furgle returns a binding for foo, say [d| foo = and |]; that
should work fine.

Simon
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.