diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-11-06 19:43:48 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-11-06 19:43:48 -0500 |
commit | 24b68e6d7408f50023272e765687eab777596363 (patch) | |
tree | 36109508292ec57f01529ab31699ed8837d3f0c8 /src/monoize.sml | |
parent | dd4d718ac9f0a9862ebef19beb568bbedcc85848 (diff) |
Tree demo working (and other assorted regressions fixed)
Diffstat (limited to 'src/monoize.sml')
-rw-r--r-- | src/monoize.sml | 16 |
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)) |