[jhc] darcs patch: Get Data.Typeable to compile

Samuel Bronson naesten at gmail.com
Mon Mar 17 06:48:39 EDT 2008


On Mon, Mar 17, 2008 at 4:09 AM, John Meacham <john at repetae.net> wrote:
> Hi, I don't want to use cpp ever more than strictly necessary, so, when
>  using it, only put it on individual files with an
>
>  {-# OPTIONS_JHC -fcpp #-} and
>  and use {-# OPTIONS_JHC -N #-} for no implicit prelude.
>
>  though, for unsafecoerce, I think just the following will do fine
>
>  {-#OPTION_JHC -N #-}
>  module Unsafe.Coerce(unsafeCoerce) where
>  import Jhc.Prim
>  unsafeCoerce = unsafeCoerce__
>
>  in general, almost all uses of CPP should be replaced by constant
>  expressions when possible, like
>
>  foo = if (sizeOf Int == 32) then foo32 else fooOther
>
>  and for doing 'meta-programming' 'm4' is much nicer than CPP so I expect
>  the main use of CPP will be in external libraries rather than any of the
>  jhc built in ones.

Well, I *did* copy and paste this from the main base repository, but I
guess that *was* rather overkill in this instance since it doesn't
share more than one line of actual code... out of three lines in the
entire module. For other, less trivial modules from that source, it
would be okay to use cpp, wouldn't it?


More information about the jhc mailing list