Mercurial > urweb
diff src/monoize.sml @ 471:20fab0e96217
Tree demo working (and other assorted regressions fixed)
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 06 Nov 2008 19:43:48 -0500 |
parents | 7cb418e9714f |
children | 366676f7bc88 |
line wrap: on
line diff
--- a/src/monoize.sml Thu Nov 06 18:49:38 2008 -0500 +++ b/src/monoize.sml Thu Nov 06 19:43:48 2008 -0500 @@ -390,6 +390,22 @@ ((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))