[Haskell-cafe] Staged evaluation, names?

wren ng thornton wren at freegeek.org
Wed Jan 7 23:25:45 EST 2009

Dear Cafe,

Every now and then I find myself in the position where I'd like to 
define some hairy value as a CAF instead of a literal, but I'd like for 
it to be fully evaluated at compile-time rather than postponed until 
runtime. It'd be possible to bludgeon the CPP into doing this, but it 
seems easier to use an autocannon like Template Haskell to swat this fly.

This seems like a common thing for folks to want but the TH 
documentation targets much higher-hanging fruit, which actually made it 
harder to figure out how to do something this basic (which would have 
been transparent with MetaML/MetaOCaml-like syntax). I've figured it out 
and circumvented the gotchas, and I was thinking of releasing the code 
as a counterpoint to all the very-high level TH tutorials.

The question for y'all is what should I call it? I've been calling the 
template-function qaf (for Compiled Applicative Form ;) and the type 
class with that function would be the only thing in the package, but I'm 
not sure where QAF.hs should be in the module hierarchy. Thoughts?

Live well,

More information about the Haskell-Cafe mailing list