summaryrefslogtreecommitdiff
path: root/src/monoize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 19:43:48 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 19:43:48 -0500
commit50e456effc2cad22d6a61e08887816096c427658 (patch)
tree36109508292ec57f01529ab31699ed8837d3f0c8 /src/monoize.sml
parent3af6c283c504e7e85d9e127f64a5eb72abe583ee (diff)
Tree demo working (and other assorted regressions fixed)
Diffstat (limited to 'src/monoize.sml')
-rw-r--r--src/monoize.sml16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index 9e1a4d22..ee509f52 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -390,6 +390,22 @@ fun fooifyExp fk env =
((L'.EApp ((L'.ENamed n, loc), e), loc), fm)
end
+ | L'.TOption t =>
+ let
+ val (body, fm) = fooify fm ((L'.ERel 0, loc), t)
+ in
+ ((L'.ECase (e,
+ [((L'.PNone t, loc),
+ (L'.EPrim (Prim.String "None"), loc)),
+
+ ((L'.PSome (t, (L'.PVar ("x", t), loc)), loc),
+ (L'.EStrcat ((L'.EPrim (Prim.String "Some/"), loc),
+ body), loc))],
+ {disc = tAll,
+ result = (L'.TFfi ("Basis", "string"), loc)}), loc),
+ fm)
+ end
+
| _ => (E.errorAt loc "Don't know how to encode attribute type";
Print.eprefaces' [("Type", MonoPrint.p_typ MonoEnv.empty tAll)];
(dummyExp, fm))