comparison src/monoize.sml @ 844:74a1e3bdf430

Fix datatype import bug in Elaborate; fix server-side source setting; more standard library stuff
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Jun 2009 16:45:00 -0400
parents 44c2c089ca15
children 0d30e6338c65
comparison
equal deleted inserted replaced
843:9f0ea203a1ca 844:74a1e3bdf430
776 (L'.TFun ((L'.TFfi ("Basis", "time"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc), 776 (L'.TFun ((L'.TFfi ("Basis", "time"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
777 (L'.EAbs ("y", (L'.TFfi ("Basis", "time"), loc), 777 (L'.EAbs ("y", (L'.TFfi ("Basis", "time"), loc),
778 (L'.TFfi ("Basis", "bool"), loc), 778 (L'.TFfi ("Basis", "bool"), loc),
779 (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc), 779 (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
780 fm) 780 fm)
781 | L.ECApp ((L.EFfi ("Basis", "eq_option"), _), t) =>
782 let
783 val t = monoType env t
784 val t' = (L'.TOption t, loc)
785 val bool = (L'.TFfi ("Basis", "bool"), loc)
786 in
787 ((L'.EAbs ("f", (L'.TFun (t, (L'.TFun (t, bool), loc)), loc),
788 (L'.TFun (t', (L'.TFun (t', bool), loc)), loc),
789 (L'.EAbs ("x", t', (L'.TFun (t', bool), loc),
790 (L'.EAbs ("y", t', bool,
791 (L'.ECase ((L'.ERecord [("1", (L'.ERel 1, loc), t'),
792 ("2", (L'.ERel 0, loc), t')], loc),
793 [((L'.PRecord [("1", (L'.PNone t, loc), t'),
794 ("2", (L'.PNone t, loc), t')], loc),
795 (L'.ECon (L'.Enum, L'.PConFfi {mod = "Basis",
796 datatyp = "bool",
797 con = "True",
798 arg = NONE},
799 NONE), loc)),
800 ((L'.PRecord [("1", (L'.PSome (t,
801 (L'.PVar ("x1",
802 t), loc)),
803 loc), t'),
804 ("2", (L'.PSome (t,
805 (L'.PVar ("x2",
806 t), loc)),
807 loc), t')], loc),
808 (L'.EApp ((L'.EApp ((L'.ERel 4, loc),
809 (L'.ERel 1, loc)), loc),
810 (L'.ERel 0, loc)), loc)),
811 ((L'.PWild, loc),
812 (L'.ECon (L'.Enum, L'.PConFfi {mod = "Basis",
813 datatyp = "bool",
814 con = "False",
815 arg = NONE},
816 NONE), loc))],
817 {disc = (L'.TRecord [("1", t'), ("2", t')], loc),
818 result = (L'.TFfi ("Basis", "bool"), loc)}),
819 loc)), loc)), loc)), loc),
820 fm)
821 end
822
781 | L.ECApp ((L.EFfi ("Basis", "mkEq"), _), t) => 823 | L.ECApp ((L.EFfi ("Basis", "mkEq"), _), t) =>
782 let 824 let
783 val t = monoType env t 825 val t = monoType env t
784 val b = (L'.TFfi ("Basis", "bool"), loc) 826 val b = (L'.TFfi ("Basis", "bool"), loc)
785 val dom = (L'.TFun (t, (L'.TFun (t, b), loc)), loc) 827 val dom = (L'.TFun (t, (L'.TFun (t, b), loc)), loc)