comparison src/corify.sml @ 193:8a70e2919e86

Specialization of single-parameter datatypes
author Adam Chlipala <adamc@hcoop.net>
date Fri, 08 Aug 2008 17:55:51 -0400
parents 9bbf4d383381
children df5fd8f6913a
comparison
equal deleted inserted replaced
192:9bbf4d383381 193:8a70e2919e86
536 val t = (L'.CNamed n, loc) 536 val t = (L'.CNamed n, loc)
537 val t = ListUtil.foldli (fn (i, _, t) => (L'.CApp (t, (L'.CRel i, loc)), loc)) t xs 537 val t = ListUtil.foldli (fn (i, _, t) => (L'.CApp (t, (L'.CRel i, loc)), loc)) t xs
538 val k = (L'.KType, loc) 538 val k = (L'.KType, loc)
539 val dcons = map (fn (x, n, to) => 539 val dcons = map (fn (x, n, to) =>
540 let 540 let
541 val args = ListUtil.mapi (fn (i, _) => (L'.CRel n, loc)) xs 541 val args = ListUtil.mapi (fn (i, _) => (L'.CRel i, loc)) xs
542 val (e, t) = 542 val (e, t) =
543 case to of 543 case to of
544 NONE => ((L'.ECon (dk, L'.PConVar n, args, NONE), loc), t) 544 NONE => ((L'.ECon (dk, L'.PConVar n, args, NONE), loc), t)
545 | SOME t' => ((L'.EAbs ("x", t', t, 545 | SOME t' => ((L'.EAbs ("x", t', t,
546 (L'.ECon (dk, L'.PConVar n, args, 546 (L'.ECon (dk, L'.PConVar n, args,