diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 09:52:52 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 09:52:52 -0400 |
commit | cbebf68dfc1e18c0477d20ea3b424ea2c97c8728 (patch) | |
tree | 3db88a4029e21443a572a90ddffdaed7eadbd04f | |
parent | f750e27d0e16da032227dbc71ecb7c63f5b77bc7 (diff) |
Monoize eq_[bool|string]
-rw-r--r-- | src/monoize.sml | 14 | ||||
-rw-r--r-- | tests/eq.ur | 6 |
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> |