Mercurial > urweb
comparison src/elab_env.sml @ 217:56db662ebcfd
Fun with type classes and modules
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 16 Aug 2008 16:30:07 -0400 |
parents | 38b299373676 |
children | a3413288cce1 |
comparison
equal
deleted
inserted
replaced
216:38b299373676 | 217:56db662ebcfd |
---|---|
711 sgiSeek (#1 sgi, fmap)) | 711 sgiSeek (#1 sgi, fmap)) |
712 | 712 |
713 fun default () = (classes, newClasses, sgiSeek (#1 sgi, fmap)) | 713 fun default () = (classes, newClasses, sgiSeek (#1 sgi, fmap)) |
714 in | 714 in |
715 case #1 sgi of | 715 case #1 sgi of |
716 SgiClassAbs xn => found xn | 716 SgiStr (x, _, sgn) => |
717 (enrichClasses env classes (m1, ms @ [x]) sgn, | |
718 newClasses, | |
719 sgiSeek (#1 sgi, fmap)) | |
720 | SgiClassAbs xn => found xn | |
717 | SgiClass (x, n, _) => found (x, n) | 721 | SgiClass (x, n, _) => found (x, n) |
718 | SgiVal (x, n, (CApp ((CNamed f, _), a), _)) => | 722 | SgiVal (x, n, (CApp ((CNamed f, _), a), _)) => |
719 (case IM.find (newClasses, f) of | 723 (case IM.find (newClasses, f) of |
720 NONE => default () | 724 NONE => default () |
721 | SOME fx => | 725 | SOME fx => |
733 in | 737 in |
734 (CM.insert (classes, cn, class), | 738 (CM.insert (classes, cn, class), |
735 newClasses, | 739 newClasses, |
736 fmap) | 740 fmap) |
737 end) | 741 end) |
742 | SgiVal _ => default () | |
738 | _ => default () | 743 | _ => default () |
739 end) | 744 end) |
740 (classes, IM.empty, (IM.empty, IM.empty, IM.empty)) sgis | 745 (classes, IM.empty, (IM.empty, IM.empty, IM.empty)) sgis |
741 in | 746 in |
742 classes | 747 classes |