comparison src/monoize.sml @ 394:9f6fe6f32961

ord_float and ord_bool
author Adam Chlipala <adamc@hcoop.net>
date Tue, 21 Oct 2008 11:19:17 -0400
parents a813476230e3
children 9f67aac13cf7
comparison
equal deleted inserted replaced
393:bc5a56ed0cd6 394:9f6fe6f32961
571 (L'.TFun ((L'.TFfi ("Basis", "int"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), 571 (L'.TFun ((L'.TFfi ("Basis", "int"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
572 (L'.EAbs ("y", (L'.TFfi ("Basis", "int"), loc), 572 (L'.EAbs ("y", (L'.TFfi ("Basis", "int"), loc),
573 (L'.TFfi ("Basis", "bool"), loc), 573 (L'.TFfi ("Basis", "bool"), loc),
574 (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc), 574 (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
575 fm) 575 fm)
576 | L.EFfi ("Basis", "eq_float") =>
577 ((L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc),
578 (L'.TFun ((L'.TFfi ("Basis", "float"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
579 (L'.EAbs ("y", (L'.TFfi ("Basis", "float"), loc),
580 (L'.TFfi ("Basis", "bool"), loc),
581 (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
582 fm)
576 | L.EFfi ("Basis", "eq_bool") => 583 | L.EFfi ("Basis", "eq_bool") =>
577 ((L'.EAbs ("x", (L'.TFfi ("Basis", "bool"), loc), 584 ((L'.EAbs ("x", (L'.TFfi ("Basis", "bool"), loc),
578 (L'.TFun ((L'.TFfi ("Basis", "bool"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), 585 (L'.TFun ((L'.TFfi ("Basis", "bool"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
579 (L'.EAbs ("y", (L'.TFfi ("Basis", "bool"), loc), 586 (L'.EAbs ("y", (L'.TFfi ("Basis", "bool"), loc),
580 (L'.TFfi ("Basis", "bool"), loc), 587 (L'.TFfi ("Basis", "bool"), loc),
725 (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc) 732 (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc)
726 in 733 in
727 ordEx ((L'.TFfi ("Basis", "int"), loc), 734 ordEx ((L'.TFfi ("Basis", "int"), loc),
728 intBin "<", 735 intBin "<",
729 intBin "<=") 736 intBin "<=")
737 end
738 | L.EFfi ("Basis", "ord_float") =>
739 let
740 fun floatBin s =
741 (L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc),
742 (L'.TFun ((L'.TFfi ("Basis", "float"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
743 (L'.EAbs ("y", (L'.TFfi ("Basis", "float"), loc),
744 (L'.TFfi ("Basis", "bool"), loc),
745 (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc)
746 in
747 ordEx ((L'.TFfi ("Basis", "float"), loc),
748 floatBin "<",
749 floatBin "<=")
750 end
751 | L.EFfi ("Basis", "ord_bool") =>
752 let
753 fun boolBin s =
754 (L'.EAbs ("x", (L'.TFfi ("Basis", "bool"), loc),
755 (L'.TFun ((L'.TFfi ("Basis", "bool"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
756 (L'.EAbs ("y", (L'.TFfi ("Basis", "bool"), loc),
757 (L'.TFfi ("Basis", "bool"), loc),
758 (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc)
759 in
760 ordEx ((L'.TFfi ("Basis", "bool"), loc),
761 boolBin "<",
762 boolBin "<=")
730 end 763 end
731 764
732 | L.ECApp ((L.EFfi ("Basis", "show"), _), t) => 765 | L.ECApp ((L.EFfi ("Basis", "show"), _), t) =>
733 let 766 let
734 val t = monoType env t 767 val t = monoType env t