[get rid of special handling of Bits class in the compiler
John Meacham <john@repetae.net>**20100709060019
 Ignore-this: 10fa0bcdbd0f8c278e337da95f43a706
] hunk ./lib/base/Data/Bits.hs 1
-{-# OPTIONS_JHC -N #-}
+{-# OPTIONS_JHC -fm4 -N -fffi  #-}
hunk ./lib/base/Data/Bits.hs 7
+import Jhc.Basics
hunk ./lib/base/Data/Bits.hs 9
+import Data.Word
+import Data.Int
+
+m4_include(Data/Bits.m4)
hunk ./lib/base/Data/Bits.hs 148
+
+BITSINST(Int,a)
+BITSINST(Int8,a)
+BITSINST(Int16,a)
+BITSINST(Int32,a)
+BITSINST(Int64,a)
+BITSINST(IntPtr,a)
+BITSINST(IntMax,a)
+BITSINST(Integer,a)
+
+BITSINST(Word)
+BITSINST(Word8)
+BITSINST(Word16)
+BITSINST(Word32)
+BITSINST(Word64)
+BITSINST(WordPtr)
+BITSINST(WordMax)
addfile ./lib/base/Data/Bits.m4
hunk ./lib/base/Data/Bits.m4 1
+m4_divert(-1)
+
+m4_define(BITSINST,{{
+
+instance Bits $1 where
+    x .&. y = and$1 x y
+    x .|. y = or$1 x y
+    x `xor` y = xor$1 x y
+    complement x = complement$1 x
+    shiftL i x = shiftL$1 x i
+    shiftR i x = shiftR$1 x i
+
+foreign import primitive "And" and$1 :: $1 -> $1 -> $1
+foreign import primitive "Or" or$1 :: $1 -> $1 -> $1
+foreign import primitive "Xor" xor$1 :: $1 -> $1 -> $1
+foreign import primitive "Shr$2" shiftR$1 :: Int -> $1 -> $1
+foreign import primitive "Shl" shiftL$1 :: Int -> $1 -> $1
+foreign import primitive "Com" complement$1 :: $1 -> $1
+
+}})
+
+m4_divert
hunk ./src/data/operators.txt 22
-aaa, .&., Data.Bits.Bits, &
-aaa, .|., Data.Bits.Bits, |
-aaa, xor, Data.Bits.Bits, ^
-aa, complement, Data.Bits.Bits, ~
+#aaa, .&., Data.Bits.Bits, &
+#aaa, .|., Data.Bits.Bits, |
+#aaa, xor, Data.Bits.Bits, ^
+#aa, complement, Data.Bits.Bits, ~
hunk ./src/data/operators.txt 30
-aIa, shiftL, Data.Bits.Bits, <<
-aIa, shiftR, Data.Bits.Bits, >>
+#aIa, shiftL, Data.Bits.Bits, <<
+#aIa, shiftR, Data.Bits.Bits, >>