comparison src/elaborate.sml @ 2094:0d898b086bbe

Improve wildify heuristic for finding record type-class witnesses
author Adam Chlipala <adam@chlipala.net>
date Tue, 23 Dec 2014 13:42:20 -0500
parents d4eb9b6729f8
children 8efba492c48b
comparison
equal deleted inserted replaced
2093:c647f113ba3e 2094:0d898b086bbe
3697 | L'.SgiVal (x, _, t) => 3697 | L'.SgiVal (x, _, t) =>
3698 let 3698 let
3699 fun should t = 3699 fun should t =
3700 let 3700 let
3701 val t = normClassConstraint env' t 3701 val t = normClassConstraint env' t
3702
3703 fun shouldR c =
3704 case hnormCon env' c of
3705 (L'.CApp (f, _), _) =>
3706 (case hnormCon env' f of
3707 (L'.CApp (f, cl), loc) =>
3708 (case hnormCon env' f of
3709 (L'.CMap _, _) => isClassOrFolder env' cl
3710 | _ => false)
3711 | _ => false)
3712 | (L'.CConcat (c1, c2), _) =>
3713 shouldR c1 orelse shouldR c2
3714 | c => false
3702 in 3715 in
3703 case #1 t of 3716 case #1 t of
3704 L'.CApp (f, _) => isClassOrFolder env' f 3717 L'.CApp (f, _) => isClassOrFolder env' f
3705 | L'.TRecord t => 3718 | L'.TRecord t => shouldR t
3706 (case hnormCon env' t of
3707 (L'.CApp (f, _), _) =>
3708 (case hnormCon env' f of
3709 (L'.CApp (f, cl), loc) =>
3710 (case hnormCon env' f of
3711 (L'.CMap _, _) => isClassOrFolder env' cl
3712 | _ => false)
3713 | _ => false)
3714 | _ => false)
3715 | _ => false 3719 | _ => false
3716 end 3720 end
3717 in 3721 in
3718 if should t then 3722 if should t then
3719 naddVal (nd, x) 3723 naddVal (nd, x)