RE: [Haskell-cafe] Template Haskell -- when are things evaluated?

2008-04-02 Thread Simon Peyton-Jones
| I'm reading the following rule from your answer: | | [|exp|] normally returns the unevaluated AST of exp. However, if exp | contains | local variables, these are lifted using Language.Haskell.TH.lift (i.e. | evaluated | before lifting). | | Is that correct? | | | / Emil | | Yes,

Re: [Haskell-cafe] Template Haskell -- when are things evaluated?

2008-03-13 Thread Alfonso Acosta
Hi Emil, Your problem is related to how are things evaluated not when. The short answer is: if you want to make sure an expression is evaluated before you lift it, don't use quasiquotes, call Language.Haskell.TH.lift On Thu, Mar 13, 2008 at 9:00 AM, Emil Axelsson [EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] Template Haskell -- when are things evaluated?

2008-03-13 Thread Emil Axelsson
Aha, I guess I thought for a while that [|x|] and lift x where the same thing. Having thought too much about partial evaluation lately, I forgot that the main purpose of quoting is to get the unevaluated AST. I'll just use lift in the future then (for partial evalutation). Thanks, Alfonso!

Re: [Haskell-cafe] Template Haskell -- when are things evaluated?

2008-03-13 Thread Emil Axelsson
I'm reading the following rule from your answer: [|exp|] normally returns the unevaluated AST of exp. However, if exp contains local variables, these are lifted using Language.Haskell.TH.lift (i.e. evaluated before lifting). Is that correct? / Emil On 2008-03-13 09:49, Alfonso Acosta

Re: [Haskell-cafe] Template Haskell -- when are things evaluated?

2008-03-13 Thread Alfonso Acosta
On Thu, Mar 13, 2008 at 11:13 AM, Emil Axelsson [EMAIL PROTECTED] wrote: I'm reading the following rule from your answer: [|exp|] normally returns the unevaluated AST of exp. However, if exp contains local variables, these are lifted using Language.Haskell.TH.lift (i.e. evaluated before