comparison src/monoize.sml @ 777:87a7702d681d

outer demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 May 2009 14:57:33 -0400
parents a8bdd5a0d9b0
children 2c463eee89fa
comparison
equal deleted inserted replaced
776:9f2555f06901 777:87a7702d681d
1033 val t = monoType env t 1033 val t = monoType env t
1034 val s = (L'.TFfi ("Basis", "string"), loc) 1034 val s = (L'.TFfi ("Basis", "string"), loc)
1035 in 1035 in
1036 ((L'.EAbs ("f", readType (t, loc), readErrType (t, loc), 1036 ((L'.EAbs ("f", readType (t, loc), readErrType (t, loc),
1037 (L'.EField ((L'.ERel 0, loc), "ReadError"), loc)), loc), fm) 1037 (L'.EField ((L'.ERel 0, loc), "ReadError"), loc)), loc), fm)
1038 end
1039 | L.ECApp ((L.EFfi ("Basis", "mkRead"), _), t) =>
1040 let
1041 val t = monoType env t
1042 val b = (L'.TFfi ("Basis", "string"), loc)
1043 val b' = (L'.TOption b, loc)
1044 val dom = (L'.TFun (t, b), loc)
1045 val dom' = (L'.TFun (t, b'), loc)
1046 in
1047 ((L'.EAbs ("f", dom, (L'.TFun (dom', readType (t, loc)), loc),
1048 (L'.EAbs ("f'", dom', readType (t, loc),
1049 (L'.ERecord [("Read", (L'.ERel 0, loc), dom),
1050 ("ReadError", (L'.ERel 1, loc), dom')], loc)), loc)), loc),
1051 fm)
1038 end 1052 end
1039 | L.EFfi ("Basis", "read_int") => 1053 | L.EFfi ("Basis", "read_int") =>
1040 let 1054 let
1041 val t = (L'.TFfi ("Basis", "int"), loc) 1055 val t = (L'.TFfi ("Basis", "int"), loc)
1042 in 1056 in