comparison src/monoize.sml @ 437:1a4c1b5f4d8f

Add time to some type classes
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Oct 2008 14:40:42 -0400
parents 024478c34f4d
children 322c8620bbdf
comparison
equal deleted inserted replaced
436:024478c34f4d 437:1a4c1b5f4d8f
595 (L'.TFun ((L'.TFfi ("Basis", "string"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), 595 (L'.TFun ((L'.TFfi ("Basis", "string"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
596 (L'.EAbs ("y", (L'.TFfi ("Basis", "string"), loc), 596 (L'.EAbs ("y", (L'.TFfi ("Basis", "string"), loc),
597 (L'.TFfi ("Basis", "bool"), loc), 597 (L'.TFfi ("Basis", "bool"), loc),
598 (L'.EBinop ("!strcmp", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc), 598 (L'.EBinop ("!strcmp", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
599 fm) 599 fm)
600 | L.EFfi ("Basis", "eq_time") =>
601 ((L'.EAbs ("x", (L'.TFfi ("Basis", "time"), loc),
602 (L'.TFun ((L'.TFfi ("Basis", "time"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
603 (L'.EAbs ("y", (L'.TFfi ("Basis", "time"), loc),
604 (L'.TFfi ("Basis", "bool"), loc),
605 (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
606 fm)
600 | L.ECApp ((L.EFfi ("Basis", "mkEq"), _), t) => 607 | L.ECApp ((L.EFfi ("Basis", "mkEq"), _), t) =>
601 let 608 let
602 val t = monoType env t 609 val t = monoType env t
603 val b = (L'.TFfi ("Basis", "bool"), loc) 610 val b = (L'.TFfi ("Basis", "bool"), loc)
604 val dom = (L'.TFun (t, (L'.TFun (t, b), loc)), loc) 611 val dom = (L'.TFun (t, (L'.TFun (t, b), loc)), loc)
794 (L'.ERel 1, loc), 801 (L'.ERel 1, loc),
795 (L'.ERel 0, loc)), loc), 802 (L'.ERel 0, loc)), loc),
796 (L'.EPrim (Prim.Int (Int64.fromInt 0)), loc)), loc)), loc)), loc) 803 (L'.EPrim (Prim.Int (Int64.fromInt 0)), loc)), loc)), loc)), loc)
797 in 804 in
798 ordEx ((L'.TFfi ("Basis", "string"), loc), 805 ordEx ((L'.TFfi ("Basis", "string"), loc),
806 boolBin "<",
807 boolBin "<=")
808 end
809 | L.EFfi ("Basis", "ord_time") =>
810 let
811 fun boolBin s =
812 (L'.EAbs ("x", (L'.TFfi ("Basis", "time"), loc),
813 (L'.TFun ((L'.TFfi ("Basis", "time"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
814 (L'.EAbs ("y", (L'.TFfi ("Basis", "time"), loc),
815 (L'.TFfi ("Basis", "bool"), loc),
816 (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc)
817 in
818 ordEx ((L'.TFfi ("Basis", "time"), loc),
799 boolBin "<", 819 boolBin "<",
800 boolBin "<=") 820 boolBin "<=")
801 end 821 end
802 822
803 | L.ECApp ((L.EFfi ("Basis", "show"), _), t) => 823 | L.ECApp ((L.EFfi ("Basis", "show"), _), t) =>