comparison 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
comparison
equal deleted inserted replaced
470:7cb418e9714f 471:20fab0e96217
386 end 386 end
387 387
388 val (fm, n) = Fm.lookup fm fk i makeDecl 388 val (fm, n) = Fm.lookup fm fk i makeDecl
389 in 389 in
390 ((L'.EApp ((L'.ENamed n, loc), e), loc), fm) 390 ((L'.EApp ((L'.ENamed n, loc), e), loc), fm)
391 end
392
393 | L'.TOption t =>
394 let
395 val (body, fm) = fooify fm ((L'.ERel 0, loc), t)
396 in
397 ((L'.ECase (e,
398 [((L'.PNone t, loc),
399 (L'.EPrim (Prim.String "None"), loc)),
400
401 ((L'.PSome (t, (L'.PVar ("x", t), loc)), loc),
402 (L'.EStrcat ((L'.EPrim (Prim.String "Some/"), loc),
403 body), loc))],
404 {disc = tAll,
405 result = (L'.TFfi ("Basis", "string"), loc)}), loc),
406 fm)
391 end 407 end
392 408
393 | _ => (E.errorAt loc "Don't know how to encode attribute type"; 409 | _ => (E.errorAt loc "Don't know how to encode attribute type";
394 Print.eprefaces' [("Type", MonoPrint.p_typ MonoEnv.empty tAll)]; 410 Print.eprefaces' [("Type", MonoPrint.p_typ MonoEnv.empty tAll)];
395 (dummyExp, fm)) 411 (dummyExp, fm))