[Haskell-cafe] Best practice for embedding files in a GHC-compiled tool?

Reinier Lamers tux_rocker at reinier.de
Fri Feb 8 08:20:06 EST 2008


Op 7-feb-2008, om 13:53 heeft Dave Bayer het volgende geschreven:
>
> Under this extreme hypothesis, how do I embed a compressed tar file  
> into a single file command line tool written in Haskell and  
> compiled by GHC?
Hack up a shell script or a small Haskell program to automatically  
generate a Haskell file of the form:

 > module TarFile where
 >
 > import Data.ByteString as B
 >
 > myTarFile = B.pack [<tar file as list of Word8s here>]

You could also do that using Template Haskell, as you already hinted,  
but this sounds less like rocket science :-)

Reinier


More information about the Haskell-Cafe mailing list