comparison src/elab_util.sml @ 213:0343557355fc

Explifying type classes
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 Aug 2008 14:45:23 -0400
parents e86411f647c6
children 19e5791923d0
comparison
equal deleted inserted replaced
212:ba4d7c33a45f 213:0343557355fc
632 bind (ctx, Str (x, sgn)) 632 bind (ctx, Str (x, sgn))
633 | DConstraint _ => ctx 633 | DConstraint _ => ctx
634 | DExport _ => ctx 634 | DExport _ => ctx
635 | DTable (tn, x, n, c) => 635 | DTable (tn, x, n, c) =>
636 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "table"), loc), 636 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "table"), loc),
637 c), loc))), 637 c), loc)))
638 | DClass (x, _, _) =>
639 bind (ctx, NamedC (x, (KArrow ((KType, loc), (KType, loc)), loc))),
638 mfd ctx d)) ctx ds, 640 mfd ctx d)) ctx ds,
639 fn ds' => (StrConst ds', loc)) 641 fn ds' => (StrConst ds', loc))
640 | StrVar _ => S.return2 strAll 642 | StrVar _ => S.return2 strAll
641 | StrProj (str, x) => 643 | StrProj (str, x) =>
642 S.map2 (mfst ctx str, 644 S.map2 (mfst ctx str,
725 | DTable (tn, x, n, c) => 727 | DTable (tn, x, n, c) =>
726 S.map2 (mfc ctx c, 728 S.map2 (mfc ctx c,
727 fn c' => 729 fn c' =>
728 (DTable (tn, x, n, c'), loc)) 730 (DTable (tn, x, n, c'), loc))
729 731
732 | DClass (x, n, c) =>
733 S.map2 (mfc ctx c,
734 fn c' =>
735 (DClass (x, n, c'), loc))
736
730 and mfvi ctx (x, n, c, e) = 737 and mfvi ctx (x, n, c, e) =
731 S.bind2 (mfc ctx c, 738 S.bind2 (mfc ctx c,
732 fn c' => 739 fn c' =>
733 S.map2 (mfe ctx e, 740 S.map2 (mfe ctx e,
734 fn e' => 741 fn e' =>