comparison src/monoize.sml @ 741:f7e2026dd5ae

Returning a blob as page result
author Adam Chlipala <adamc@hcoop.net>
date Sun, 26 Apr 2009 09:02:17 -0400
parents d049d31a1966
children 2c7244c066f1
comparison
equal deleted inserted replaced
740:b302b6e35f93 741:f7e2026dd5ae
126 (L'.TFun (mt env dtmap t, (L'.TFfi ("Basis", "string"), loc)), loc) 126 (L'.TFun (mt env dtmap t, (L'.TFfi ("Basis", "string"), loc)), loc)
127 | L.CApp ((L.CFfi ("Basis", "read"), _), t) => 127 | L.CApp ((L.CFfi ("Basis", "read"), _), t) =>
128 readType (mt env dtmap t, loc) 128 readType (mt env dtmap t, loc)
129 129
130 | L.CFfi ("Basis", "url") => (L'.TFfi ("Basis", "string"), loc) 130 | L.CFfi ("Basis", "url") => (L'.TFfi ("Basis", "string"), loc)
131 | L.CFfi ("Basis", "mimeType") => (L'.TFfi ("Basis", "string"), loc)
131 | L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "xml"), _), _), _), _), _), _) => 132 | L.CApp ((L.CApp ((L.CApp ((L.CFfi ("Basis", "xml"), _), _), _), _), _), _) =>
132 (L'.TFfi ("Basis", "string"), loc) 133 (L'.TFfi ("Basis", "string"), loc)
133 | L.CApp ((L.CApp ((L.CFfi ("Basis", "xhtml"), _), _), _), _) => 134 | L.CApp ((L.CApp ((L.CFfi ("Basis", "xhtml"), _), _), _), _) =>
134 (L'.TFfi ("Basis", "string"), loc) 135 (L'.TFfi ("Basis", "string"), loc)
135 | L.CFfi ("Basis", "css_class") => (L'.TFfi ("Basis", "string"), loc) 136 | L.CFfi ("Basis", "css_class") => (L'.TFfi ("Basis", "string"), loc)
2558 in 2559 in
2559 ((L'.EAbs ("s", (L'.TFfi ("Basis", "string"), loc), t, 2560 ((L'.EAbs ("s", (L'.TFfi ("Basis", "string"), loc), t,
2560 (L'.EError ((L'.ERel 0, loc), t), loc)), loc), 2561 (L'.EError ((L'.ERel 0, loc), t), loc)), loc),
2561 fm) 2562 fm)
2562 end 2563 end
2564 | L.ECApp ((L.EFfi ("Basis", "returnBlob"), _), t) =>
2565 let
2566 val t = monoType env t
2567 val un = (L'.TRecord [], loc)
2568 in
2569 ((L'.EAbs ("b", (L'.TFfi ("Basis", "blob"), loc),
2570 (L'.TFun ((L'.TFfi ("Basis", "string"), loc), (L'.TFun (un, t), loc)), loc),
2571 (L'.EAbs ("mt", (L'.TFfi ("Basis", "string"), loc), (L'.TFun (un, t), loc),
2572 (L'.EAbs ("_", un, t,
2573 (L'.EReturnBlob {blob = (L'.ERel 2, loc),
2574 mimeType = (L'.ERel 1, loc),
2575 t = t}, loc)), loc)), loc)), loc),
2576 fm)
2577 end
2563 2578
2564 | L.EApp (e1, e2) => 2579 | L.EApp (e1, e2) =>
2565 let 2580 let
2566 val (e1, fm) = monoExp (env, st, fm) e1 2581 val (e1, fm) = monoExp (env, st, fm) e1
2567 val (e2, fm) = monoExp (env, st, fm) e2 2582 val (e2, fm) = monoExp (env, st, fm) e2