Mercurial > urweb
comparison src/mono_util.sml @ 51:92361a008a10
FFI through monoize
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 22 Jun 2008 10:12:23 -0400 |
parents | 537db4ee89f4 |
children | 40d146f467c5 |
comparison
equal
deleted
inserted
replaced
50:d37518b67bd2 | 51:92361a008a10 |
---|---|
52 fn t' => | 52 fn t' => |
53 (x, t'))) | 53 (x, t'))) |
54 xts, | 54 xts, |
55 fn xts' => (TRecord xts', loc)) | 55 fn xts' => (TRecord xts', loc)) |
56 | TNamed _ => S.return2 cAll | 56 | TNamed _ => S.return2 cAll |
57 | TFfi _ => S.return2 cAll | |
57 in | 58 in |
58 mft | 59 mft |
59 end | 60 end |
60 | 61 |
61 fun map typ c = | 62 fun map typ c = |
96 and mfe' ctx (eAll as (e, loc)) = | 97 and mfe' ctx (eAll as (e, loc)) = |
97 case e of | 98 case e of |
98 EPrim _ => S.return2 eAll | 99 EPrim _ => S.return2 eAll |
99 | ERel _ => S.return2 eAll | 100 | ERel _ => S.return2 eAll |
100 | ENamed _ => S.return2 eAll | 101 | ENamed _ => S.return2 eAll |
102 | EFfi _ => S.return2 eAll | |
103 | EFfiApp (m, x, es) => | |
104 S.map2 (ListUtil.mapfold (fn e => mfe ctx e) es, | |
105 fn es' => | |
106 (EFfiApp (m, x, es'), loc)) | |
101 | EApp (e1, e2) => | 107 | EApp (e1, e2) => |
102 S.bind2 (mfe ctx e1, | 108 S.bind2 (mfe ctx e1, |
103 fn e1' => | 109 fn e1' => |
104 S.map2 (mfe ctx e2, | 110 S.map2 (mfe ctx e2, |
105 fn e2' => | 111 fn e2' => |