Mercurial > urweb
comparison src/monoize.sml @ 144:f0d3402184d1
Simple forms work
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 22 Jul 2008 15:12:20 -0400 |
parents | 4b9c2bd6157c |
children | 15e8b9775539 |
comparison
equal
deleted
inserted
replaced
143:4b9c2bd6157c | 144:f0d3402184d1 |
---|---|
381 val env = foldl (fn ((x, n, t, e, s), env) => Env.pushENamed env x n t NONE s) env vis | 381 val env = foldl (fn ((x, n, t, e, s), env) => Env.pushENamed env x n t NONE s) env vis |
382 in | 382 in |
383 SOME (env, | 383 SOME (env, |
384 (L'.DValRec (map (fn (x, n, t, e, s) => (x, n, monoType env t, monoExp env e, s)) vis), loc)) | 384 (L'.DValRec (map (fn (x, n, t, e, s) => (x, n, monoType env t, monoExp env e, s)) vis), loc)) |
385 end | 385 end |
386 | L.DExport n => | 386 | L.DExport (ek, n) => |
387 let | 387 let |
388 val (_, t, _, s) = Env.lookupENamed env n | 388 val (_, t, _, s) = Env.lookupENamed env n |
389 | 389 |
390 fun unwind (t, _) = | 390 fun unwind (t, _) = |
391 case t of | 391 case t of |
392 L.TFun (dom, ran) => dom :: unwind ran | 392 L.TFun (dom, ran) => dom :: unwind ran |
393 | _ => [] | 393 | _ => [] |
394 | 394 |
395 val ts = map (monoType env) (unwind t) | 395 val ts = map (monoType env) (unwind t) |
396 in | 396 in |
397 SOME (env, (L'.DExport (s, n, ts), loc)) | 397 SOME (env, (L'.DExport (ek, s, n, ts), loc)) |
398 end | 398 end |
399 end | 399 end |
400 | 400 |
401 fun monoize env ds = | 401 fun monoize env ds = |
402 let | 402 let |