comparison src/mono_util.sml @ 338:e976b187d73a

SQL sequences
author Adam Chlipala <adamc@hcoop.net>
date Sun, 14 Sep 2008 11:02:18 -0400
parents 52d4c60518d4
children 7abb28e9d51f
comparison
equal deleted inserted replaced
337:18d5affa790d 338:e976b187d73a
288 288
289 | EDml e => 289 | EDml e =>
290 S.map2 (mfe ctx e, 290 S.map2 (mfe ctx e,
291 fn e' => 291 fn e' =>
292 (EDml e', loc)) 292 (EDml e', loc))
293 | ENextval e =>
294 S.map2 (mfe ctx e,
295 fn e' =>
296 (ENextval e', loc))
293 in 297 in
294 mfe 298 mfe
295 end 299 end
296 300
297 fun mapfold {typ = fc, exp = fe} = 301 fun mapfold {typ = fc, exp = fe} =
373 | DExport (ek, s, n, ts) => 377 | DExport (ek, s, n, ts) =>
374 S.map2 (ListUtil.mapfold mft ts, 378 S.map2 (ListUtil.mapfold mft ts,
375 fn ts' => 379 fn ts' =>
376 (DExport (ek, s, n, ts'), loc)) 380 (DExport (ek, s, n, ts'), loc))
377 | DTable _ => S.return2 dAll 381 | DTable _ => S.return2 dAll
382 | DSequence _ => S.return2 dAll
378 | DDatabase _ => S.return2 dAll 383 | DDatabase _ => S.return2 dAll
379 384
380 and mfvi ctx (x, n, t, e, s) = 385 and mfvi ctx (x, n, t, e, s) =
381 S.bind2 (mft t, 386 S.bind2 (mft t,
382 fn t' => 387 fn t' =>
437 | DVal (x, n, t, e, s) => bind (ctx, NamedE (x, n, t, SOME e, s)) 442 | DVal (x, n, t, e, s) => bind (ctx, NamedE (x, n, t, SOME e, s))
438 | DValRec vis => foldl (fn ((x, n, t, e, s), ctx) => 443 | DValRec vis => foldl (fn ((x, n, t, e, s), ctx) =>
439 bind (ctx, NamedE (x, n, t, NONE, s))) ctx vis 444 bind (ctx, NamedE (x, n, t, NONE, s))) ctx vis
440 | DExport _ => ctx 445 | DExport _ => ctx
441 | DTable _ => ctx 446 | DTable _ => ctx
447 | DSequence _ => ctx
442 | DDatabase _ => ctx 448 | DDatabase _ => ctx
443 in 449 in
444 S.map2 (mff ctx' ds', 450 S.map2 (mff ctx' ds',
445 fn ds' => 451 fn ds' =>
446 d' :: ds') 452 d' :: ds')