comparison src/monoize.sml @ 564:803b2f3bb86b

Monad type class seems to be working
author Adam Chlipala <adamc@hcoop.net>
date Fri, 19 Dec 2008 10:27:58 -0500
parents 5d494183ca89
children 74800be65591
comparison
equal deleted inserted replaced
563:44958d74c43f 564:803b2f3bb86b
932 ("ReadError", (L'.EFfi ("Basis", "stringToTime_error"), loc), readErrType (t, loc))], 932 ("ReadError", (L'.EFfi ("Basis", "stringToTime_error"), loc), readErrType (t, loc))],
933 loc), 933 loc),
934 fm) 934 fm)
935 end 935 end
936 936
937 | L.ECApp ((L.EFfi ("Basis", "return"), _), t) => 937 | L.EApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "return"), _), _), _), t), _),
938 (L.EFfi ("Basis", "transaction_monad"), _)) =>
938 let 939 let
939 val t = monoType env t 940 val t = monoType env t
940 in 941 in
941 ((L'.EAbs ("x", t, 942 ((L'.EAbs ("x", t,
942 (L'.TFun ((L'.TRecord [], loc), t), loc), 943 (L'.TFun ((L'.TRecord [], loc), t), loc),
943 (L'.EAbs ("_", (L'.TRecord [], loc), t, 944 (L'.EAbs ("_", (L'.TRecord [], loc), t,
944 (L'.ERel 1, loc)), loc)), loc), fm) 945 (L'.ERel 1, loc)), loc)), loc), fm)
945 end 946 end
946 | L.ECApp ((L.ECApp ((L.EFfi ("Basis", "bind"), _), t1), _), t2) => 947 | L.EApp ((L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "bind"), _), _), _), t1), _), t2), _),
948 (L.EFfi ("Basis", "transaction_monad"), _)) =>
947 let 949 let
948 val t1 = monoType env t1 950 val t1 = monoType env t1
949 val t2 = monoType env t2 951 val t2 = monoType env t2
950 val un = (L'.TRecord [], loc) 952 val un = (L'.TRecord [], loc)
951 val mt1 = (L'.TFun (un, t1), loc) 953 val mt1 = (L'.TFun (un, t1), loc)