Re: [Haskell-cafe] Compile-time evaluation

2007-11-03 Thread Alfonso Acosta
Hi Nicholas, > compileTimeEval :: Data a => a -> ExpQ > compileTimeEval = return . toExp > You're telling me all that horrendous pain in implementing toExp and it already exists?!? Yes unfortunately, compileTimeEval already exists in TH, it's called lift compileTimeEval :: Lift a => a -> ExpQ

Re: [Haskell-cafe] Compile-time evaluation

2007-11-02 Thread Nicholas Messenger
On 11/2/07, Robin Green <[EMAIL PROTECTED]> wrote: > ...since > there is a Template Haskell class for the concept of "translating actual > values into TH representations of those values" called Lift... There's a WHAT?! *checks docs* You're telling me all that horrendous pain in implementing to

Re: [Haskell-cafe] Compile-time evaluation

2007-11-02 Thread Robin Green
On Fri, 2 Nov 2007 05:11:53 -0500 "Nicholas Messenger" <[EMAIL PROTECTED]> wrote: > -- Many people ask if GHC will evaluate toplevel constants at compile > -- time, you know, since Haskell is pure it'd be great if those > -- computations could be done once and not use up cycles during > -- runtime

[Haskell-cafe] Compile-time evaluation

2007-11-02 Thread Nicholas Messenger
{-# OPTIONS_GHC -fglasgow-exts -fno-monomorphism-restriction #-} -- Many people ask if GHC will evaluate toplevel constants at compile -- time, you know, since Haskell is pure it'd be great if those -- computations could be done once and not use up cycles during -- runtime. Not an entirely bad id