diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 11:22:10 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 11:22:10 -0400 |
commit | c4631a8e9c0b2eb95e99f89357858f771578178a (patch) | |
tree | 319426c4fdbfb8671deb36ca32dfe7172827efdb /src/monoize.sml | |
parent | eaa8b82f581b0b2c59e4867b2f5455084b6b181b (diff) |
ord_string
Diffstat (limited to 'src/monoize.sml')
-rw-r--r-- | src/monoize.sml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 8ffe3f1b..06156544 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -761,6 +761,23 @@ fun monoExp (env, st, fm) (all as (e, loc)) = boolBin "<", boolBin "<=") end + | L.EFfi ("Basis", "ord_string") => + let + fun boolBin s = + (L'.EAbs ("x", (L'.TFfi ("Basis", "string"), loc), + (L'.TFun ((L'.TFfi ("Basis", "string"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), + (L'.EAbs ("y", (L'.TFfi ("Basis", "string"), loc), + (L'.TFfi ("Basis", "bool"), loc), + (L'.EBinop (s, + (L'.EBinop ("strcmp", + (L'.ERel 1, loc), + (L'.ERel 0, loc)), loc), + (L'.EPrim (Prim.Int (Int64.fromInt 0)), loc)), loc)), loc)), loc) + in + ordEx ((L'.TFfi ("Basis", "string"), loc), + boolBin "<", + boolBin "<=") + end | L.ECApp ((L.EFfi ("Basis", "show"), _), t) => let |