[various changes relating to switching unboxed representations, make 'Char' a regular haskell data type rather than a special built in.
John Meacham <john@repetae.net>**20070531023331] hunk ./DataConstructors.hs 483
-    oper_IIB op a b = EPrim (APrim (Op (Op.BinOp op Op.bits_int Op.bits_int) Op.bits_int) mempty) [a,b] tBoolzh
+    oper_IIB op a b = EPrim (APrim (Op (Op.BinOp op Op.bits32 Op.bits32) Op.bits32) mempty) [a,b] tBoolzh
hunk ./E/FromHs.hs 625
-intConvert i =  ELit (litCons { litName = dc_Int, litArgs = [ELit $ LitInt (fromInteger i) (rawType "bits<int>")], litType = tInt })
+intConvert i =  ELit (litCons { litName = dc_Int, litArgs = [ELit $ LitInt (fromInteger i) (rawType "bits32")], litType = tInt })
hunk ./E/FromHs.hs 630
-        False -> (dc_Int,tInt,f_fromInt,"bits<int>")
+        False -> (dc_Int,tInt,f_fromInt,"bits32")
hunk ./E/PrimOpt.hs 141
---    binOps = [("divide","/"),("plus","+"),("minus","-"),("times","*"),("modulus","%")]
-
hunk ./E/PrimOpt.hs 159
---    primopt op [a,b] t | Just cop <- lookup op binOps = mdo
---        (pa,(ta,sta)) <- extractPrimitive dataTable a
---        (pb,(tb,stb)) <- extractPrimitive dataTable b
---        (bp,(tr,str)) <- boxPrimitive dataTable
---                (EPrim (APrim (Operator cop [ta,ta] tr) mempty) [pa, pb] str) t
---        return bp
-    primopt "equalsChar" [a,b] t = return (EPrim (APrim (Op (Op.BinOp Op.Eq Op.bits32 Op.bits32) Op.bits_int) mempty) [a,b] t)
hunk ./E/PrimOpt.hs 179
-    primopt "integralCast" [e] t = return $ create_integralCast dataTable e t
hunk ./E/Show.hs 71
-        f LitCons { litName = n, litArgs = [], litType = t } | t == tTag = return $  atom $ (const_color (text $ show n))
hunk ./E/Show.hs 257
-tTag = rawType "tag#"
-rawType s  = ELit litCons { litName = toName RawType s, litType = eHash }
-
hunk ./E/Values.hs 176
-tTag = ELit litCons { litName = rt_tag, litArgs = [], litType = eHash }
hunk ./Name/Names.hs 69
-tc_Word8__ = toName TypeConstructor  ("Jhc.Prim","Word8__")
-tc_Char__ = toName TypeConstructor  ("Jhc.Prim","Char__")
-tc_Bool__ = toName TypeConstructor  ("Jhc.Prim","Bool__")
hunk ./Name/Names.hs 78
-rt_tag = toName RawType "tag#"
-
hunk ./data/names.txt 5
+Char      Jhc.Prim.Char
hunk ./data/names.txt 41
+Char       Jhc.Prim.Char
hunk ./data/primitives.txt 5
-Jhc.Prim.Char, ubits32, char, UINT32_MAX, 0
+# Jhc.Prim.Char, ubits32, char, UINT32_MAX, 0
hunk ./lib/base/Jhc/Basics.hs 5
+import Jhc.Int
hunk ./lib/base/Jhc/Basics.hs 157
-foreign import primitive "U2U" ord :: Char -> Int
-foreign import primitive "I2I" chr :: Int -> Char
+ord :: Char -> Int
+ord (Char c) = boxInt c
+
+chr :: Int -> Char
+chr i = Char (unboxInt i)
+
+{-
+foreign import primitive "ULte" bits32ULte  :: Bits32_ -> Bits32_ -> Bool__
+foreign import primitive "error.Prelude.chr: value out of range" chr_error :: a
+
+chr :: Int -> Char
+chr i = case unboxInt i of
+    i' -> case i' `bits32ULTE` 0x10FFFF# of
+        1# -> Char i'
+        0# -> chr_error
+
+unsafeChr :: Int -> Char
+unsafeChr i = Char (unboxInt i)
+-}
+
hunk ./lib/base/Jhc/Enum.hs 1
-{-# OPTIONS_JHC -N -fffi #-}
+{-# OPTIONS_JHC -N -fffi -funboxed-values #-}
hunk ./lib/base/Jhc/Enum.hs 6
+import Jhc.Types
hunk ./lib/base/Jhc/Enum.hs 70
-    enumFromTo x y = f x where
-        f x | x > y = []
-            | otherwise = x:f (incrementChar x)
-    enumFromThenTo x y z | y `seq` True = f x where
-        inc = y `minusChar` x
-        f x | x >= z = x:f (x `plusChar` inc)
-            | otherwise = []
+    enumFromTo (Char x) (Char y) = f x where
+        f x = case x `bits32UGt` y of
+            0# -> []
+            1# -> Char x:f (bits32Increment x)
+    enumFromThenTo (Char x) (Char y) (Char z) =
+        case y `bits32Sub` x of
+            inc -> let f x = case x `bits32UGte` z of
+                            1# -> Char x:f (x `bits32Add` inc)
+                            0# -> []
+             in f x
+
+
+instance Bounded Char where
+    minBound = Char 0#
+    maxBound = Char 0x10ffff#
+
+foreign import primitive "UGt"       bits32UGt       :: Bits32_ -> Bits32_ -> Bool__
+foreign import primitive "UGte"       bits32UGte      :: Bits32_ -> Bits32_ -> Bool__
+foreign import primitive "increment" bits32Increment :: Bits32_ -> Bits32_
+
+foreign import primitive "Add"       bits32Add      :: Bits32_ -> Bits32_ -> Bits32_
+foreign import primitive "Sub"       bits32Sub      :: Bits32_ -> Bits32_ -> Bits32_
hunk ./lib/base/Jhc/Enum.hs 94
-foreign import primitive "increment" incrementChar :: Char -> Char
-foreign import primitive "plus"      plusChar      :: Char -> Char -> Char
-foreign import primitive "minus"     minusChar     :: Char -> Char -> Char
hunk ./lib/base/Jhc/IO.hs 5
+    thenIO,
+    thenIO_,
+    returnIO,
+
hunk ./lib/base/Jhc/IO.hs 11
+
hunk ./lib/base/Jhc/IO.hs 156
+returnIO :: a -> IO a
+returnIO x = IO $ \w -> (# w, x #)
+
hunk ./lib/base/Jhc/Order.hs 77
+instance Eq Char where
+    Char x == Char y = boxBool (equalsChar x y)
+    Char x /= Char y = boxBool (nequalsChar x y)
+
+instance Ord Char where
+    Char x < Char y = boxBool (bits32ULt x y)
+    Char x > Char y = boxBool (bits32UGt x y)
+    Char x <= Char y = boxBool (bits32ULte x y)
+    Char x >= Char y = boxBool (bits32UGte x y)
+
hunk ./lib/base/Jhc/Order.hs 105
+foreign import primitive "Eq" equalsChar :: Char__ -> Char__ -> Bool__
+foreign import primitive "NEq" nequalsChar :: Char__ -> Char__ -> Bool__
+foreign import primitive "ULt" bits32ULt :: Char__ -> Char__ -> Bool__
+foreign import primitive "ULte" bits32ULte :: Char__ -> Char__ -> Bool__
+foreign import primitive "UGt" bits32UGt :: Char__ -> Char__ -> Bool__
+foreign import primitive "UGte" bits32UGte :: Char__ -> Char__ -> Bool__
+foreign import primitive "box" boxBool :: Bool__ -> Bool
+
hunk ./lib/base/Jhc/Prim.hs 17
-data Char
+data Char = Char Char__
hunk ./lib/base/Jhc/Prim.hs 19
-type Bool__ = Bits1_
+type Bool__ = Bits32_ -- Change to Bits1_ when the time comes
hunk ./lib/base/Jhc/String.hs 22
-        c -> (box c:f (increment addr))
+        c -> (Char c:f (increment addr))
hunk ./lib/base/Jhc/String.hs 54
-        c -> (box c `cons` f (increment addr))
+        c -> (Char c `cons` f (increment addr))
hunk ./lib/base/Jhc/String.hs 61
-    f offset (c:cs) = case constPeekByte offset of
+    f offset (Char c:cs) = case constPeekByte offset of
hunk ./lib/base/Jhc/String.hs 63
-        uc -> case equalsChar uc (unbox c) of
+        uc -> case equalsChar uc c of
hunk ./lib/base/Jhc/String.hs 68
-eqSingleChar ch (c:cs) = case equalsChar ch (unbox c) of
+eqSingleChar ch (Char c:cs) = case equalsChar ch c of
hunk ./lib/base/Jhc/String.hs 80
-    f offset (c:cs) = case constPeekByte offset of
+    f offset (Char c:cs) = case constPeekByte offset of
hunk ./lib/base/Jhc/String.hs 82
-        uc -> case equalsChar uc (unbox c) of
+        uc -> case equalsChar uc c of
hunk ./lib/base/Jhc/String.hs 92
-eqString (x:xs) (y:ys) = case equalsChar (unbox x) (unbox y) of
+eqString (Char x:xs) (Char y:ys) = case equalsChar x y of
hunk ./lib/base/Jhc/String.hs 97
-foreign import primitive unbox :: Char -> Char__
hunk ./lib/base/Jhc/String.hs 98
-foreign import primitive box :: Char__ -> Char
-foreign import primitive equalsChar :: Char__ -> Char__ -> Bool__
+foreign import primitive "Eq" equalsChar :: Char__ -> Char__ -> Bool__