Compiling data

Mark Alexander Wotton mwotton at cse.unsw.EDU.AU
Thu May 27 19:03:43 EDT 2004

On Thu, 27 May 2004, Ketil Malde wrote:

> Christian Maeder <maeder at> writes:
> > We have put a large list in double quotes and used "read" to convert
> > the large literal string (too big for hugs, though) into the needed
> > list. This reduced compile time drastically, but I don't know how the
> > runtime changed. (Also errors can only occur at runtime.)
> Yes, that seemed to do the trick!  Don't think there was much of a
> runtime cost, certainly less than the previous compile cost.

This is something I was playing with a little while ago. I had a large
data structure that took a long time to build at runtime, so I thought I
might try compiling the data in using Template Haskell.  When I tried
compiling it, though, GHC spun its wheels for several minutes before
quitting (don't have the source code online, so I can't find the exact
error message). If anyone's got an idea how to do this sort of thing in a
reasonable amount of time, I'd be grateful.

(My best current idea (actually Don Stewart's) is to build it using one
program, then serialise it and dump it to disk. It's a bit hacky, though:
it'd be much more pleasant to do it all inside TH.)


i'm an old testament kind of guy
i like my coffee black and my parole denied
        -- The Dismemberment Plan, Sentimental Man

More information about the Glasgow-haskell-users mailing list