# HG changeset patch # User Adam Chlipala # Date 1224597172 14400 # Node ID 2e93d18daf44c22f7cc929c4f8921152df6517db # Parent 7abb28e9d51fcba962557c874fa0296bde8d4af3 Monoize eq_[bool|string] diff -r 7abb28e9d51f -r 2e93d18daf44 src/monoize.sml --- a/src/monoize.sml Tue Oct 21 09:50:19 2008 -0400 +++ b/src/monoize.sml Tue Oct 21 09:52:52 2008 -0400 @@ -530,6 +530,20 @@ (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 -r 7abb28e9d51f -r 2e93d18daf44 tests/eq.ur --- a/tests/eq.ur Tue Oct 21 09:50:19 2008 -0400 +++ b/tests/eq.ur Tue Oct 21 09:52:52 2008 -0400 @@ -1,4 +1,8 @@ fun main () : transaction page = return {txt _ (1 = 1)}, {txt _ (1 = 2)}
- {txt _ (1 <> 1)}, {txt _ (1 <> 2)} + {txt _ (1 <> 1)}, {txt _ (1 <> 2)}
+ {txt _ (True = True)}, {txt _ (True = False)}
+ {txt _ (True <> True)}, {txt _ (True <> False)}
+ {txt _ ("A" = "A")}, {txt _ ("A" = "B")}
+ {txt _ ("A" <> "A")}, {txt _ ("A" <> "B")}