# HG changeset patch # User Adam Chlipala # Date 1224601464 14400 # Node ID a813476230e3e5506d71a3ca51da83efaeb7b3e3 # Parent fe8f75f7e1306d87c5350f69a873b0225dd0002c gt, ge diff -r fe8f75f7e130 -r a813476230e3 src/monoize.sml --- a/src/monoize.sml Tue Oct 21 10:56:43 2008 -0400 +++ b/src/monoize.sml Tue Oct 21 11:04:24 2008 -0400 @@ -683,6 +683,38 @@ ((L'.EAbs ("r", ordTy t, (L'.TFun (t, (L'.TFun (t, (L'.TFfi ("Basis", "bool"), loc)), loc)), loc), (L'.EField ((L'.ERel 0, loc), "Le"), loc)), loc), fm) end + | L.ECApp ((L.EFfi ("Basis", "gt"), _), t) => + let + val t = monoType env t + val b = (L'.TFfi ("Basis", "bool"), loc) + in + ((L'.EAbs ("f", ordTy t, (L'.TFun (t, (L'.TFun (t, b), loc)), loc), + (L'.EAbs ("x", t, (L'.TFun (t, b), loc), + (L'.EAbs ("y", t, b, + (L'.EUnop ("!", + (L'.EApp ((L'.EApp ((L'.EField ((L'.ERel 2, loc), + "Le"), loc), + (L'.ERel 1, loc)), loc), + (L'.ERel 0, loc)), loc)), loc)), loc)), + loc)), + loc), fm) + end + | L.ECApp ((L.EFfi ("Basis", "ge"), _), t) => + let + val t = monoType env t + val b = (L'.TFfi ("Basis", "bool"), loc) + in + ((L'.EAbs ("f", ordTy t, (L'.TFun (t, (L'.TFun (t, b), loc)), loc), + (L'.EAbs ("x", t, (L'.TFun (t, b), loc), + (L'.EAbs ("y", t, b, + (L'.EUnop ("!", + (L'.EApp ((L'.EApp ((L'.EField ((L'.ERel 2, loc), + "Lt"), loc), + (L'.ERel 1, loc)), loc), + (L'.ERel 0, loc)), loc)), loc)), loc)), + loc)), + loc), fm) + end | L.EFfi ("Basis", "ord_int") => let fun intBin s = diff -r fe8f75f7e130 -r a813476230e3 tests/ord.ur --- a/tests/ord.ur Tue Oct 21 10:56:43 2008 -0400 +++ b/tests/ord.ur Tue Oct 21 11:04:24 2008 -0400 @@ -1,3 +1,3 @@ fun main () : transaction page = return - {[ 1 < 1 ]}, {[ 1 < 2 ]}, {[ 1 <= 1 ]}, {[ 2 <= 1 ]} + {[ 1 < 1 ]}, {[ 1 < 2 ]}, {[ 1 <= 1 ]}, {[ 2 <= 1 ]}, {[ 1 > 1 ]}, {[ 2 > 1 ]}, {[ 0 >= 1 ]}, {[ 2 >= 1 ]}