comparison src/corify.sml @ 87:275aaeb73f1f

Push KUnit and CUnit through the phases
author Adam Chlipala <adamc@hcoop.net>
date Tue, 01 Jul 2008 13:23:46 -0400
parents 8b611ecc5f2d
children f0f59e918cac
comparison
equal deleted inserted replaced
86:7f9bcc8bfa1e 87:275aaeb73f1f
273 case k of 273 case k of
274 L.KType => (L'.KType, loc) 274 L.KType => (L'.KType, loc)
275 | L.KArrow (k1, k2) => (L'.KArrow (corifyKind k1, corifyKind k2), loc) 275 | L.KArrow (k1, k2) => (L'.KArrow (corifyKind k1, corifyKind k2), loc)
276 | L.KName => (L'.KName, loc) 276 | L.KName => (L'.KName, loc)
277 | L.KRecord k => (L'.KRecord (corifyKind k), loc) 277 | L.KRecord k => (L'.KRecord (corifyKind k), loc)
278 | L.KUnit => (L'.KUnit, loc)
278 279
279 fun corifyCon st (c, loc) = 280 fun corifyCon st (c, loc) =
280 case c of 281 case c of
281 L.TFun (t1, t2) => (L'.TFun (corifyCon st t1, corifyCon st t2), loc) 282 L.TFun (t1, t2) => (L'.TFun (corifyCon st t1, corifyCon st t2), loc)
282 | L.TCFun (x, k, t) => (L'.TCFun (x, corifyKind k, corifyCon st t), loc) 283 | L.TCFun (x, k, t) => (L'.TCFun (x, corifyKind k, corifyCon st t), loc)
304 305
305 | L.CRecord (k, xcs) => 306 | L.CRecord (k, xcs) =>
306 (L'.CRecord (corifyKind k, map (fn (c1, c2) => (corifyCon st c1, corifyCon st c2)) xcs), loc) 307 (L'.CRecord (corifyKind k, map (fn (c1, c2) => (corifyCon st c1, corifyCon st c2)) xcs), loc)
307 | L.CConcat (c1, c2) => (L'.CConcat (corifyCon st c1, corifyCon st c2), loc) 308 | L.CConcat (c1, c2) => (L'.CConcat (corifyCon st c1, corifyCon st c2), loc)
308 | L.CFold (k1, k2) => (L'.CFold (corifyKind k1, corifyKind k2), loc) 309 | L.CFold (k1, k2) => (L'.CFold (corifyKind k1, corifyKind k2), loc)
310 | L.CUnit => (L'.CUnit, loc)
309 311
310 fun corifyExp st (e, loc) = 312 fun corifyExp st (e, loc) =
311 case e of 313 case e of
312 L.EPrim p => (L'.EPrim p, loc) 314 L.EPrim p => (L'.EPrim p, loc)
313 | L.ERel n => (L'.ERel n, loc) 315 | L.ERel n => (L'.ERel n, loc)