[Haskell-cafe] A 3 line program. Preprocessor?

Svein Ove Aas svein.ove at aas.no
Tue Oct 27 11:25:06 EDT 2009


On Tue, Oct 27, 2009 at 3:57 PM, Philippos Apolinarius
<phi500ac at yahoo.ca> wrote:
>
> In a private email to Ketil Malde, I said that Ocaml programmers use the preprocessor to solve the problem of character encoding:
>
> ocamlopt -pp myfilter.exe myprogram.ml -o myoutput.exe
>
> I wonder whether a similar solution could be used with Haskell. I am new to Haskell, but I suppose that Haskell may accept something like
>
> ghc -pgmF myfilter.exe myprogram.hs --make
>
> If the answer is yes, what should I substitute for myfilter.exe?
>
Converting a non-utf-8 input file to utf-8?

There's no obvious reason it shouldn't work, and you could use recode
for the filter.

However, wouldn't it be much better to just generate utf-8 in the
first place? I find it hard to believe that it's really as hard as all
that.


--
Svein Ove Aas


More information about the Haskell-Cafe mailing list