diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 11:19:17 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 11:19:17 -0400 |
commit | eaa8b82f581b0b2c59e4867b2f5455084b6b181b (patch) | |
tree | 922127dfce596e6b321b6c1d4b695460491325e6 /src | |
parent | 8d110361aec2e04253f964b304d3c42e35bdb918 (diff) |
ord_float and ord_bool
Diffstat (limited to 'src')
-rw-r--r-- | src/monoize.sml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 4e92c02e..8ffe3f1b 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -573,6 +573,13 @@ fun monoExp (env, st, fm) (all as (e, loc)) = (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 @@ fun monoExp (env, st, fm) (all as (e, loc)) = 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 |