[add optimizations for unary arguments on constants
John Meacham <john@repetae.net>**20070606115023] hunk ./C/OpEval.hs 68
+
+    f FDiv v1 v2 | v2 /= 0 = return $ toExpression (v1 / v2) str
+    f FMul v1 v2 = return $ toExpression (v1 * v2) str
+
hunk ./C/OpEval.hs 97
+
hunk ./C/OpEval.hs 103
+    f FDiv e1 e2 | Just (1,_) <- toConstant e2 = return e1
+    f FPwr e1 e2 | Just (1,_) <- toConstant e2 = return e1
+    f FMul e1 e2 | Just (1,_) <- toConstant e1 = return e2
+    f FAdd e1 e2 | Just (0,_) <- toConstant e1 = return e2
+    f FSub e1 e2 | Just (0,_) <- toConstant e2 = return e1
+
hunk ./C/OpEval.hs 133
+unOp :: Expression t e => UnOp -> Ty -> Ty -> e -> t -> Maybe e
+unOp op t1 tr e str | Just (v,t) <- toConstant e = f op v where
+    f Neg v = return $ toExpression (negate v) str
+    f FNeg v = return $ toExpression (negate v) str
+    f FAbs v = return $ toExpression (abs v) str
+    f _ _ = Nothing
+unOp op t1 tr e str = Nothing
+
hunk ./E/PrimOpt.hs 68
-            _ -> fail "could not apply conversion optimization"
+            _ -> fail "could noUnt apply conversion optimization"
+        primopt (Op (Op.UnOp bop t1) tr) [e1] rt = unOp bop t1 tr e1 rt