comparison src/corify.sml @ 110:3739af9e727a

Starting with closure links
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Jul 2008 11:43:57 -0400
parents 813e5a52063d
children 2d6116de9cca
comparison
equal deleted inserted replaced
109:813e5a52063d 110:3739af9e727a
356 | L.EApp (e1, e2) => (L'.EApp (corifyExp st e1, corifyExp st e2), loc) 356 | L.EApp (e1, e2) => (L'.EApp (corifyExp st e1, corifyExp st e2), loc)
357 | L.EAbs (x, dom, ran, e1) => (L'.EAbs (x, corifyCon st dom, corifyCon st ran, corifyExp st e1), loc) 357 | L.EAbs (x, dom, ran, e1) => (L'.EAbs (x, corifyCon st dom, corifyCon st ran, corifyExp st e1), loc)
358 | L.ECApp (e1, c) => (L'.ECApp (corifyExp st e1, corifyCon st c), loc) 358 | L.ECApp (e1, c) => (L'.ECApp (corifyExp st e1, corifyCon st c), loc)
359 | L.ECAbs (x, k, e1) => (L'.ECAbs (x, corifyKind k, corifyExp st e1), loc) 359 | L.ECAbs (x, k, e1) => (L'.ECAbs (x, corifyKind k, corifyExp st e1), loc)
360 360
361 | L.ERecord xes => (L'.ERecord (map (fn (c, e, t) => (corifyCon st c, corifyExp st e, corifyCon st t)) xes), loc) 361 | L.ERecord xes => (L'.ERecord (map (fn (c, e, t) =>
362 (corifyCon st c, corifyExp st e, corifyCon st t)) xes), loc)
362 | L.EField (e1, c, {field, rest}) => (L'.EField (corifyExp st e1, corifyCon st c, 363 | L.EField (e1, c, {field, rest}) => (L'.EField (corifyExp st e1, corifyCon st c,
363 {field = corifyCon st field, rest = corifyCon st rest}), loc) 364 {field = corifyCon st field, rest = corifyCon st rest}), loc)
364 | L.EFold k => (L'.EFold (corifyKind k), loc) 365 | L.EFold k => (L'.EFold (corifyKind k), loc)
365 | L.EWrite e => (L'.EWrite (corifyExp st e), loc) 366 | L.EWrite e => (L'.EWrite (corifyExp st e), loc)
366 367
448 case sgi of 449 case sgi of
449 L.SgiVal (s, _, t as (L.TFun (dom, ran), _)) => 450 L.SgiVal (s, _, t as (L.TFun (dom, ran), _)) =>
450 (case (#1 dom, #1 ran) of 451 (case (#1 dom, #1 ran) of
451 (L.TRecord _, 452 (L.TRecord _,
452 L.CApp ((L.CModProj (_, [], "xml"), _), 453 L.CApp ((L.CModProj (_, [], "xml"), _),
453 (L.TRecord (L.CRecord (_, [((L.CName "Html", _), 454 (L.CRecord (_, [((L.CName "Html", _),
454 _)]), _), _))) => 455 _)]), _))) =>
455 let 456 let
456 val ran = (L.TRecord (L.CRecord ((L.KType, loc), []), loc), loc) 457 val ran = (L.TRecord (L.CRecord ((L.KType, loc), []), loc), loc)
457 val e = (L.EModProj (m, ms, s), loc) 458 val e = (L.EModProj (m, ms, s), loc)
458 val e = (L.EAbs ("vs", dom, ran, 459 val e = (L.EAbs ("vs", dom, ran,
459 (L.EWrite (L.EApp (e, (L.ERel 0, loc)), loc), loc)), loc) 460 (L.EWrite (L.EApp (e, (L.ERel 0, loc)), loc), loc)), loc)