[convert internal references to Bool to use new enumeration representation
John Meacham <john@repetae.net>**20060721091415] hunk ./E/E.hs 224
-instance ConNames (Lit x E) where
-    vTrue  = (LitCons vTrue [] tBool)
-    vFalse = (LitCons vFalse [] tBool)
+instance ConNames (Lit E E) where
+    vTrue  = (LitCons dc_Boolzh [ELit (LitInt 1 tIntzh)] tBool)
+    vFalse = (LitCons dc_Boolzh [ELit (LitInt 0 tIntzh)] tBool)
hunk ./E/FromHs.hs 75
+--eIf e a b = ECase { eCaseScrutinee = e, eCaseType = getType a, eCaseBind = (tVr 0 tBool),  eCaseAlts =  [Alt vTrue a,Alt vFalse b], eCaseDefault = Nothing }
+
+
+createIf e a b = do
+    [tv] <- newVars [Unknown]
+    return $ createIfv tv e a b
+
+createIfv v e a b = res where
+    tv = v { tvrType = tIntzh }
+    ic = eCase (EVar tv) [Alt (LitInt 1 tIntzh) a, Alt (LitInt 0 tIntzh) b] Unknown
+    res = eCase e [Alt (LitCons dc_Boolzh [tv] tBool) ic] Unknown
+
hunk ./E/FromHs.hs 519
-    cExpr (HsIf e a b) = liftM3 eIf (cExpr e) (cExpr a) (cExpr b)
+    cExpr (HsIf e a b) = join $ liftM3 createIf (cExpr e) (cExpr a) (cExpr b)
hunk ./E/FromHs.hs 563
-        return (\els -> eIf g e (fg els))
+        [nv] <- newVars [Unknown]
+        return (\els -> createIfv nv g e (fg els))
hunk ./E/FromHs.hs 580
-        f (HsGuardedRhs _ g e:gs) = liftM3 eIf (cExpr g) (cExpr e) (f gs)
+        f (HsGuardedRhs _ g e:gs) = join $ liftM3 createIf (cExpr g) (cExpr e) (f gs)
hunk ./E/FromHs.hs 697
-                        return $ eIf (EAp (EAp eq (EVar bv)) ip) m els
+                        createIf (EAp (EAp eq (EVar bv)) ip) m els
hunk ./E/FromHs.hs 702
-                        return $ eIf (EAp (EAp eq (EVar bv)) ip) m els
+                        createIf (EAp (EAp eq (EVar bv)) ip) m els
hunk ./E/Values.hs 33
-eIf e a b = ECase { eCaseScrutinee = e, eCaseType = getType a, eCaseBind = (tVr 0 tBool),  eCaseAlts =  [Alt vTrue a,Alt vFalse b], eCaseDefault = Nothing }
hunk ./Grin/Val.hs 11
-nil      = convertName dc_EmptyList -- (toAtom "CPrelude.[]")
-cons     = convertName dc_Cons -- (toAtom "CPrelude.:")
-cChar    = convertName dc_Char -- toAtom "CPrelude.Char"
-cInt     = convertName dc_Int --toAtom "CPrelude.Int"
+nil      = convertName dc_EmptyList
+cons     = convertName dc_Cons
+cChar    = convertName dc_Char
+cInt     = convertName dc_Int
hunk ./Grin/Val.hs 16
-tn_True  = convertName dc_True  -- toAtom "CPrelude.True"
-tn_False = convertName dc_False -- toAtom "CPrelude.False"
-tn_unit  = convertName dc_Unit -- toAtom "CPrelude.()"
+--tn_True  = convertName dc_True  -- toAtom "CPrelude.True"
+--tn_False = convertName dc_False -- toAtom "CPrelude.False"
+tn_Boolzh = convertName dc_Boolzh
+tn_unit  = convertName dc_Unit
hunk ./Grin/Val.hs 22
-    vTrue = NodeC tn_True []
-    vFalse = NodeC tn_False []
-    vUnit =  NodeC tn_unit []
-    vOrdering x = NodeC (toAtom $ "CPrelude." ++ show x) []
+    vTrue  = NodeC tn_Boolzh [toUnVal (1 :: Int)]
+    vFalse = NodeC tn_Boolzh [toUnVal (0 :: Int)]
+    vUnit  = NodeC tn_unit []
hunk ./Grin/Val.hs 47
-instance ToVal Ordering where
-    toVal x = vOrdering x
hunk ./Name/Names.hs 32
-    vTrue = dc_True
-    vFalse = dc_False
+--    vTrue = dc_True
+--    vFalse = dc_False
hunk ./Name/Names.hs 64
-dc_False = toName DataConstructor ("Prelude","False")
+--dc_False = toName DataConstructor ("Prelude","False")
hunk ./Name/Names.hs 67
-dc_True = toName DataConstructor ("Prelude","True")
+--dc_True = toName DataConstructor ("Prelude","True")
hunk ./Name/Names.hs 69
+dc_Boolzh = toName DataConstructor ("Prelude","Bool#")
hunk ./data/PrimitiveOperators-in.hs 96
---buildAbs v t = eIf (EPrim (primPrim "prim_op_aaB.<") [EVar v,(ELit (LitInt 0 t))] tBool) (EPrim (primPrim "prim_op_aa.-") [EVar v] t) (EVar v)
---build_abs ct cn v = unbox' v cn tvra (eCase (EPrim (APrim (Operator "<" [ct,ct] "int") mempty) [EVar tvra, zero] intt) [Alt zeroI (rebox $ EVar tvra)] (fs)) where
hunk ./data/PrimitiveOperators-in.hs 106
-buildSignum v t = eCase (EVar v) [Alt (LitInt 0 t) (ELit (LitInt 0 t))] (eIf (EPrim (primPrim "prim_op_aaB.<") [EVar v,(ELit (LitInt 0 t))] tBool) (ELit (LitInt (-1) t)) (ELit (LitInt 1  t)))