
Hi, Am Mittwoch, den 04.08.2010, 08:05 +0100 schrieb Max Bolingbroke:
On 4 August 2010 07:42, Joachim Breitner
wrote: out of a discussion in haskell-devscripts, John MacFarlane wrote a very nice tool, called hsb2hs, that allows you to include any binary (or text) file as a constant in your program.
When I've needed to do this in the past, I've used a simple bit of Template Haskell:
the problem is that Template Haskell does not work on all architectures, so the Debian people prefer solutions that avoid TH if it is not needed. Yet another solution would be to create an ELF file contiangin the binary blob as described in http://burtonini.com/blog/computers/ld-blobs-2007-07-13-15-50 and link to it using FFI. But I’m not sure if there are any gains. Maybe for very large files where even _parsing_ the string literal by ghc takes too long. Greetings, Joachim -- Joachim "nomeata" Breitner mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/ Debian Developer: nomeata@debian.org