static constants -- ideas?

Jay Scott jay at satirist.org
Sat Mar 1 15:24:03 EST 2008


Jason Dusek jason.dusek at gmail.com:
>Bryan O'Sullivan <bos at serpentine.com> wrote:
>> The trick I usually use in cases like this is to compile the
>> data as C code and link against it, then access it from
>> Haskell via a Ptr.
>
>  For my particular application, I really need to ship a single
>  static binary that has it all -- data as well as algorithms --
>  so I'm going with the FFI. It's too bad that I end up working
>  in the IO monad much of the time. I hope we'll have massive
>  static constants someday soon!

unsafePerformIO should be safe on constants, right? It has worked for
me, at least.

  Jay



More information about the Glasgow-haskell-users mailing list