comparison src/core_util.sml @ 48:0a5c312de09a

Start of FFI
author Adam Chlipala <adamc@hcoop.net>
date Sun, 22 Jun 2008 09:27:29 -0400
parents 537db4ee89f4
children 8e9920db39f2
comparison
equal deleted inserted replaced
47:ac4c0b4111ba 48:0a5c312de09a
107 fn c' => 107 fn c' =>
108 (TRecord c', loc)) 108 (TRecord c', loc))
109 109
110 | CRel _ => S.return2 cAll 110 | CRel _ => S.return2 cAll
111 | CNamed _ => S.return2 cAll 111 | CNamed _ => S.return2 cAll
112 | CFfi _ => S.return2 cAll
112 | CApp (c1, c2) => 113 | CApp (c1, c2) =>
113 S.bind2 (mfc ctx c1, 114 S.bind2 (mfc ctx c1,
114 fn c1' => 115 fn c1' =>
115 S.map2 (mfc ctx c2, 116 S.map2 (mfc ctx c2,
116 fn c2' => 117 fn c2' =>
214 and mfe' ctx (eAll as (e, loc)) = 215 and mfe' ctx (eAll as (e, loc)) =
215 case e of 216 case e of
216 EPrim _ => S.return2 eAll 217 EPrim _ => S.return2 eAll
217 | ERel _ => S.return2 eAll 218 | ERel _ => S.return2 eAll
218 | ENamed _ => S.return2 eAll 219 | ENamed _ => S.return2 eAll
220 | EFfi _ => S.return2 eAll
221 | EFfiApp (m, x, es) =>
222 S.map2 (ListUtil.mapfold (fn e => mfe ctx e) es,
223 fn es' =>
224 (EFfiApp (m, x, es'), loc))
219 | EApp (e1, e2) => 225 | EApp (e1, e2) =>
220 S.bind2 (mfe ctx e1, 226 S.bind2 (mfe ctx e1,
221 fn e1' => 227 fn e1' =>
222 S.map2 (mfe ctx e2, 228 S.map2 (mfe ctx e2,
223 fn e2' => 229 fn e2' =>