Mercurial > urweb
comparison src/monoize.sml @ 572:57018f21cd5c
Handling singnal bind
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 21 Dec 2008 12:30:57 -0500 |
parents | 86d324061ddc |
children | ac947e2f29ff |
comparison
equal
deleted
inserted
replaced
571:86d324061ddc | 572:57018f21cd5c |
---|---|
955 val t2 = monoType env t2 | 955 val t2 = monoType env t2 |
956 val un = (L'.TRecord [], loc) | 956 val un = (L'.TRecord [], loc) |
957 val mt1 = (L'.TFun (un, t1), loc) | 957 val mt1 = (L'.TFun (un, t1), loc) |
958 val mt2 = (L'.TFun (un, t2), loc) | 958 val mt2 = (L'.TFun (un, t2), loc) |
959 in | 959 in |
960 ((L'.EAbs ("m1", mt1, (L'.TFun (mt1, (L'.TFun (mt2, (L'.TFun (un, un), loc)), loc)), loc), | 960 ((L'.EAbs ("m1", mt1, (L'.TFun ((L'.TFun (t1, mt2), loc), (L'.TFun (un, un), loc)), loc), |
961 (L'.EAbs ("m2", mt2, (L'.TFun (un, un), loc), | 961 (L'.EAbs ("m2", (L'.TFun (t1, mt2), loc), (L'.TFun (un, un), loc), |
962 (L'.EAbs ("_", un, un, | 962 (L'.EAbs ("_", un, un, |
963 (L'.ELet ("r", t1, (L'.EApp ((L'.ERel 2, loc), | 963 (L'.ELet ("r", t1, (L'.EApp ((L'.ERel 2, loc), |
964 (L'.ERecord [], loc)), loc), | 964 (L'.ERecord [], loc)), loc), |
965 (L'.EApp ( | 965 (L'.EApp ( |
966 (L'.EApp ((L'.ERel 2, loc), (L'.ERel 0, loc)), loc), | 966 (L'.EApp ((L'.ERel 2, loc), (L'.ERel 0, loc)), loc), |
985 let | 985 let |
986 val t = monoType env t | 986 val t = monoType env t |
987 in | 987 in |
988 ((L'.EAbs ("x", t, (L'.TSignal t, loc), | 988 ((L'.EAbs ("x", t, (L'.TSignal t, loc), |
989 (L'.ESignalReturn (L'.ERel 0, loc), loc)), loc), | 989 (L'.ESignalReturn (L'.ERel 0, loc), loc)), loc), |
990 fm) | |
991 end | |
992 | L.EApp ((L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "bind"), _), _), _), t1), _), t2), _), | |
993 (L.EFfi ("Basis", "signal_monad"), _)) => | |
994 let | |
995 val t1 = monoType env t1 | |
996 val t2 = monoType env t2 | |
997 val un = (L'.TRecord [], loc) | |
998 val mt1 = (L'.TSignal t1, loc) | |
999 val mt2 = (L'.TSignal t2, loc) | |
1000 in | |
1001 ((L'.EAbs ("m1", mt1, (L'.TFun ((L'.TFun (t1, mt2), loc), mt2), loc), | |
1002 (L'.EAbs ("m2", (L'.TFun (t1, mt2), loc), mt2, | |
1003 (L'.ESignalBind ((L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc), | |
990 fm) | 1004 fm) |
991 end | 1005 end |
992 | 1006 |
993 | L.ECApp ((L.EFfi ("Basis", "getCookie"), _), t) => | 1007 | L.ECApp ((L.EFfi ("Basis", "getCookie"), _), t) => |
994 let | 1008 let |