Is it possible to build in a file in a haskell program??

Glynn Clements glynn.clements@virgin.net
Wed, 30 Apr 2003 05:16:50 +0100


Alexandre Weffort Thenorio wrote:

> OK. Here is what happen. I wrote the small haskell program that write=

> another haskell program containing a string representation of the bin=
 file.
>=20
> If use openFile function the string representation is not complete (D=
oesn't
> write the whole bin file, bug maybe) but if I use openFileEx (IOExts
> Library, Lang Package) it writes the whole thing
>=20
> BUT both ways it still gives me a file with a binary string represent=
ation
> (Weird sings) like:
>=20
> module MyBinFile ( mybinfile ) where
> mybinfile :: String
> mybinfile =3D "=06=01=1B=CC   =FEs=06=01$>=CC  =06=01=03=CC =06 =FE=06=
=01V=CC =0C=130=191o=10 =A6=08=B7=01?=03sf=CC{%z-=E6=04=C7=01d=E6=05=C7=
=01e_
> =07=C6=01e\\\\=C3=E0Q'%=D1=E0z&=F2=C6=01d=D1=E0y&=E7=D6=E0{=C7=01d=D6=
=E0|=C7=01ez-=C6=01d=E7=04=C6=01e=E7=05?=01 0=030
> =050...."
>=20
> thus of course giving me a error in character literal in third line w=
hen
> trying to run the old main (That is gonna rewrite the bin file). Any =
ideas??

Use "show", e.g.

=09hPutStrLn outFile $ "mybinfile =3D " ++ show theString

--=20
Glynn Clements <glynn.clements@virgin.net>