- primop_rule IntEqOp = one_rule (relop (==)) ++ case_rule (litEq True)
- primop_rule IntNeOp = one_rule (relop (/=)) ++ case_rule (litEq False)
- primop_rule CharEqOp = one_rule (relop (==)) ++ case_rule (litEq True)
- primop_rule CharNeOp = one_rule (relop (/=)) ++ case_rule (litEq False)
-
- primop_rule IntGtOp = one_rule (relop (>))
- primop_rule IntGeOp = one_rule (relop (>=))
- primop_rule IntLeOp = one_rule (relop (<=))
- primop_rule IntLtOp = one_rule (relop (<))
-
- primop_rule CharGtOp = one_rule (relop (>))
- primop_rule CharGeOp = one_rule (relop (>=))
- primop_rule CharLeOp = one_rule (relop (<=))
- primop_rule CharLtOp = one_rule (relop (<))
-
- primop_rule FloatGtOp = one_rule (relop (>))
- primop_rule FloatGeOp = one_rule (relop (>=))
- primop_rule FloatLeOp = one_rule (relop (<=))
- primop_rule FloatLtOp = one_rule (relop (<))
- primop_rule FloatEqOp = one_rule (relop (==))
- primop_rule FloatNeOp = one_rule (relop (/=))
-
- primop_rule DoubleGtOp = one_rule (relop (>))
- primop_rule DoubleGeOp = one_rule (relop (>=))
- primop_rule DoubleLeOp = one_rule (relop (<=))
- primop_rule DoubleLtOp = one_rule (relop (<))
- primop_rule DoubleEqOp = one_rule (relop (==))
- primop_rule DoubleNeOp = one_rule (relop (/=))
-
- primop_rule WordGtOp = one_rule (relop (>))
- primop_rule WordGeOp = one_rule (relop (>=))
- primop_rule WordLeOp = one_rule (relop (<=))
- primop_rule WordLtOp = one_rule (relop (<))
- primop_rule WordEqOp = one_rule (relop (==))
- primop_rule WordNeOp = one_rule (relop (/=))
-
- primop_rule other = []
-
-
- relop cmp = twoLits (cmpOp (\ord -> ord `cmp` EQ))
- -- Cunning. cmpOp compares the values to give an Ordering.
- -- It applies its argument to that ordering value to turn
- -- the ordering into a boolean value. (`cmp` EQ) is just the job.
+ primop_rule IntEqOp = relop (==) ++ litEq op_name True
+ primop_rule IntNeOp = relop (/=) ++ litEq op_name False
+ primop_rule CharEqOp = relop (==) ++ litEq op_name True
+ primop_rule CharNeOp = relop (/=) ++ litEq op_name False
+
+ primop_rule IntGtOp = relop (>)
+ primop_rule IntGeOp = relop (>=)
+ primop_rule IntLeOp = relop (<=)
+ primop_rule IntLtOp = relop (<)
+
+ primop_rule CharGtOp = relop (>)
+ primop_rule CharGeOp = relop (>=)
+ primop_rule CharLeOp = relop (<=)
+ primop_rule CharLtOp = relop (<)
+
+ primop_rule FloatGtOp = relop (>)
+ primop_rule FloatGeOp = relop (>=)
+ primop_rule FloatLeOp = relop (<=)
+ primop_rule FloatLtOp = relop (<)
+ primop_rule FloatEqOp = relop (==)
+ primop_rule FloatNeOp = relop (/=)
+
+ primop_rule DoubleGtOp = relop (>)
+ primop_rule DoubleGeOp = relop (>=)
+ primop_rule DoubleLeOp = relop (<=)
+ primop_rule DoubleLtOp = relop (<)
+ primop_rule DoubleEqOp = relop (==)
+ primop_rule DoubleNeOp = relop (/=)
+
+ primop_rule WordGtOp = relop (>)
+ primop_rule WordGeOp = relop (>=)
+ primop_rule WordLeOp = relop (<=)
+ primop_rule WordLtOp = relop (<)
+ primop_rule WordEqOp = relop (==)
+ primop_rule WordNeOp = relop (/=)
+
+ primop_rule _ = []
+
+