[c generation clean ups
John Meacham <john@repetae.net>**20100330084838
 Ignore-this: fea5e0470c3ecbeb0c520b3972d0b029
] hunk ./src/C/FromGrin2.hs 625
-    f (Lit i (TyPrim Op.TyBool)) = return $ if i == 0 then constant cFalse else constant cTrue
+    f (Lit i (TyPrim Op.TyBool)) = return $ toExpression (i /= 0)
hunk ./src/C/Generate.hs 17
-    cTrue,cFalse,
hunk ./src/C/Generate.hs 108
-
hunk ./src/C/Generate.hs 113
-    thPtr :: Bool,
-    thConst :: Bool,
-    thNoAssign :: Bool,
-    thOmittable :: Bool
+    thPtr :: !Bool,
+    thConst :: !Bool,
+    thNoAssign :: !Bool,
+    thOmittable :: !Bool
hunk ./src/C/Generate.hs 349
-operator :: String -> Expression -> Expression -> Expression
-operator o x y = expDC (pdraw x <+> text o <+> pdraw y)
+operator :: (ToExpression a,ToExpression b) => String -> a -> b -> Expression
+operator o x y = expDC (pdraw (toExpression x) <+> text o <+> pdraw (toExpression y))
hunk ./src/C/Generate.hs 661
-eq :: Expression -> Expression -> Expression
+eq :: (ToExpression x, ToExpression y) => x -> y -> Expression
hunk ./src/C/Generate.hs 666
-(=*) :: Expression -> Expression -> Statement
-x =* y = x `assign` y
+(=*) :: (ToExpression x, ToExpression y) => x -> y -> Statement
+x =* y = toExpression x `assign` toExpression y
hunk ./src/C/Generate.hs 684
+instance ToExpression a => ToStatement a where
+    toStatement x = toStatement $ toExpression x
+
hunk ./src/C/Generate.hs 705
+instance (ToExpression a,ToExpression b) => ToExpression (a,b) where
+    toExpression (x,y) = commaExpression [toExpression x,toExpression y]
+