GHCi (was Re: Mixture of Integer and Float arithmetic without "fromIntegral "?)

Marcin 'Qrczak' Kowalczyk mk167280@students.mimuw.edu.pl
Mon, 11 Dec 2000 12:26:40 +0100 (CET)


On Mon, 11 Dec 2000, Simon Marlow wrote:

> In principle, yes.  But there are several stages to GHC's compilation
> cycle; where exactly the user-specified preprocessing stage would fit
> in is something we'd need to discuss.

Aren't there only two reasonably "standard" and "portable" stages: just
before and just after unliteration? And unliteration itself is a kind of
such source preprocessing. So it's really a question of specifying the
order of preprocessings.

When multiple preprocessors are being applied, it's not obvious what
extensions to use. I tried to allow such stacking in my hsc2hs
preprocessor by letting it accept any name ending in "c" and creating the
output file with this "c" removed, thus turning foo.hsc into foo.hs and
foo.lhsc into foo.lhs.

Perhaps it would be better to mark a source to be preprocessed by
appending a whole new extension with its own dot instead of modifying the
old extension, like autoconf turning config.h.in into config.h.

Preprocessors in general may produce more files. For example hsc2hs
sometimes produces .c and .h files as well. This requires a naming
convention too.

It would be cool if Makefiles could be avoided in simple cases, or at
least be simpler. I just want ghc to do the right thing with all kinds of
files. ghc --make looks promising.

-- 
Marcin 'Qrczak' Kowalczyk