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

John Meacham john at repetae.net
Mon Mar 17 05:09:15 EDT 2008


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.


        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the jhc mailing list