comparison src/expl_util.sml @ 213:0343557355fc

Explifying type classes
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 Aug 2008 14:45:23 -0400
parents ab86aa858e6c
children 3aa010e97db9
comparison
equal deleted inserted replaced
212:ba4d7c33a45f 213:0343557355fc
55 S.map2 (mfk k, 55 S.map2 (mfk k,
56 fn k' => 56 fn k' =>
57 (KRecord k', loc)) 57 (KRecord k', loc))
58 58
59 | KUnit => S.return2 kAll 59 | KUnit => S.return2 kAll
60
61 | KTuple ks =>
62 S.map2 (ListUtil.mapfold mfk ks,
63 fn ks' =>
64 (KTuple ks', loc))
60 in 65 in
61 mfk 66 mfk
62 end 67 end
63 68
64 fun exists f k = 69 fun exists f k =
146 S.map2 (mfk k2, 151 S.map2 (mfk k2,
147 fn k2' => 152 fn k2' =>
148 (CFold (k1', k2'), loc))) 153 (CFold (k1', k2'), loc)))
149 154
150 | CUnit => S.return2 cAll 155 | CUnit => S.return2 cAll
156
157 | CTuple cs =>
158 S.map2 (ListUtil.mapfold (mfc ctx) cs,
159 fn cs' =>
160 (CTuple cs', loc))
161
162 | CProj (c, n) =>
163 S.map2 (mfc ctx c,
164 fn c' =>
165 (CProj (c', n), loc))
151 in 166 in
152 mfc 167 mfc
153 end 168 end
154 169
155 fun mapfold {kind = fk, con = fc} = 170 fun mapfold {kind = fk, con = fc} =