summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/monoize.sml14
-rw-r--r--tests/eq.ur6
2 files changed, 19 insertions, 1 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index 7428b7fa..21798b0f 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -530,6 +530,20 @@ 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_bool") =>
+ ((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 ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
+ fm)
+ | L.EFfi ("Basis", "eq_string") =>
+ ((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 ("!strcmp", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
+ fm)
| L.ECApp ((L.EFfi ("Basis", "show"), _), t) =>
let
diff --git a/tests/eq.ur b/tests/eq.ur
index 1a780a57..4f758e0f 100644
--- a/tests/eq.ur
+++ b/tests/eq.ur
@@ -1,4 +1,8 @@
fun main () : transaction page = return <xml><body>
{txt _ (1 = 1)}, {txt _ (1 = 2)}<br/>
- {txt _ (1 <> 1)}, {txt _ (1 <> 2)}
+ {txt _ (1 <> 1)}, {txt _ (1 <> 2)}<br/>
+ {txt _ (True = True)}, {txt _ (True = False)}<br/>
+ {txt _ (True <> True)}, {txt _ (True <> False)}<br/>
+ {txt _ ("A" = "A")}, {txt _ ("A" = "B")}<br/>
+ {txt _ ("A" <> "A")}, {txt _ ("A" <> "B")}<br/>
</body></xml>