Mercurial > urweb
diff 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 |
line wrap: on
line diff
--- a/src/monoize.sml Tue Oct 21 11:13:03 2008 -0400 +++ b/src/monoize.sml Tue Oct 21 11:19:17 2008 -0400 @@ -573,6 +573,13 @@ (L'.TFfi ("Basis", "bool"), loc), (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc), fm) + | L.EFfi ("Basis", "eq_float") => + ((L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc), + (L'.TFun ((L'.TFfi ("Basis", "float"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), + (L'.EAbs ("y", (L'.TFfi ("Basis", "float"), loc), + (L'.TFfi ("Basis", "bool"), loc), + (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc), + fm) | L.EFfi ("Basis", "eq_bool") => ((L'.EAbs ("x", (L'.TFfi ("Basis", "bool"), loc), (L'.TFun ((L'.TFfi ("Basis", "bool"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), @@ -728,6 +735,32 @@ intBin "<", intBin "<=") end + | L.EFfi ("Basis", "ord_float") => + let + fun floatBin s = + (L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc), + (L'.TFun ((L'.TFfi ("Basis", "float"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), + (L'.EAbs ("y", (L'.TFfi ("Basis", "float"), loc), + (L'.TFfi ("Basis", "bool"), loc), + (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc) + in + ordEx ((L'.TFfi ("Basis", "float"), loc), + floatBin "<", + floatBin "<=") + end + | L.EFfi ("Basis", "ord_bool") => + let + fun boolBin s = + (L'.EAbs ("x", (L'.TFfi ("Basis", "bool"), loc), + (L'.TFun ((L'.TFfi ("Basis", "bool"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), + (L'.EAbs ("y", (L'.TFfi ("Basis", "bool"), loc), + (L'.TFfi ("Basis", "bool"), loc), + (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc) + in + ordEx ((L'.TFfi ("Basis", "bool"), loc), + boolBin "<", + boolBin "<=") + end | L.ECApp ((L.EFfi ("Basis", "show"), _), t) => let