comparison src/monoize.sml @ 697:755a71c99be5

Threads demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 05 Apr 2009 10:48:11 -0400
parents 500e93aa436f
children 70cbdcf5989b
comparison
equal deleted inserted replaced
696:79a49c509007 697:755a71c99be5
982 (L'.EApp ((L'.ERel 2, loc), (L'.ERel 0, loc)), loc), 982 (L'.EApp ((L'.ERel 2, loc), (L'.ERel 0, loc)), loc),
983 (L'.ERecord [], loc)), 983 (L'.ERecord [], loc)),
984 loc)), loc)), loc)), loc)), loc), 984 loc)), loc)), loc)), loc)), loc),
985 fm) 985 fm)
986 end 986 end
987
987 | L.EApp ((L.EApp ((L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "bind"), _), _), _), _), _), t2), _), 988 | L.EApp ((L.EApp ((L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "bind"), _), _), _), _), _), t2), _),
988 (L.EFfi ("Basis", "transaction_monad"), _)), _), 989 (L.EFfi ("Basis", "transaction_monad"), _)), _),
989 (L.EApp ((L.ECApp ((L.EFfi ("Basis", "recv"), _), t1), _), 990 (L.EApp ((L.ECApp ((L.EFfi ("Basis", "recv"), _), t1), _),
990 ch), loc)) => 991 ch), loc)) =>
991 let 992 let
1000 (L'.ERecv (liftExpInExp 0 (liftExpInExp 0 ch), 1001 (L'.ERecv (liftExpInExp 0 (liftExpInExp 0 ch),
1001 (L'.ERel 1, loc), 1002 (L'.ERel 1, loc),
1002 t1), loc)), loc)), loc), 1003 t1), loc)), loc)), loc),
1003 fm) 1004 fm)
1004 end 1005 end
1006 | L.EFfiApp ("Basis", "recv", _) => poly ()
1007
1005 | L.EApp ((L.EApp ((L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "bind"), _), _), _), _), _), t2), _), 1008 | L.EApp ((L.EApp ((L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "bind"), _), _), _), _), _), t2), _),
1006 (L.EFfi ("Basis", "transaction_monad"), _)), _), 1009 (L.EFfi ("Basis", "transaction_monad"), _)), _),
1007 (L.EAbs (_, _, _, 1010 (L.EAbs (_, _, _,
1008 (L.EFfiApp ("Basis", "sleep", [n]), _)), loc)) => 1011 (L.EFfiApp ("Basis", "sleep", [n]), _)), loc)) =>
1009 let 1012 let
1012 val mt2 = (L'.TFun (un, t2), loc) 1015 val mt2 = (L'.TFun (un, t2), loc)
1013 val (n, fm) = monoExp (env, st, fm) n 1016 val (n, fm) = monoExp (env, st, fm) n
1014 in 1017 in
1015 ((L'.EAbs ("m2", (L'.TFun (un, mt2), loc), (L'.TFun (un, un), loc), 1018 ((L'.EAbs ("m2", (L'.TFun (un, mt2), loc), (L'.TFun (un, un), loc),
1016 (L'.EAbs ("_", un, un, 1019 (L'.EAbs ("_", un, un,
1017 (L'.ESleep (n, (L'.EApp ((L'.ERel 1, loc), 1020 (L'.ESleep (liftExpInExp 0 n, (L'.EApp ((L'.ERel 1, loc),
1018 (L'.ERecord [], loc)), loc)), 1021 (L'.ERecord [], loc)), loc)),
1019 loc)), loc)), loc), 1022 loc)), loc)), loc),
1020 fm) 1023 fm)
1021 end 1024 end
1025 | L.EFfiApp ("Basis", "sleep", _) => poly ()
1022 1026
1023 | L.ECApp ((L.EFfi ("Basis", "source"), _), t) => 1027 | L.ECApp ((L.EFfi ("Basis", "source"), _), t) =>
1024 let 1028 let
1025 val t = monoType env t 1029 val t = monoType env t
1026 in 1030 in