comparison src/mono_reduce.sml @ 456:1a4fa157fedd

Monoizing FFI transactions correctly
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 09:21:34 -0500
parents 9095a95a1bf9
children 21bb5bbba2e9
comparison
equal deleted inserted replaced
455:d4a81273d4b1 456:1a4fa157fedd
350 | ELet (x, t, e, (EAbs (x', t' as (TRecord [], _), ran, e'), loc)) => 350 | ELet (x, t, e, (EAbs (x', t' as (TRecord [], _), ran, e'), loc)) =>
351 EAbs (x', t', ran, (ELet (x, t, liftExpInExp 0 e, swapExpVars 0 e'), loc)) 351 EAbs (x', t', ran, (ELet (x, t, liftExpInExp 0 e, swapExpVars 0 e'), loc))
352 352
353 | ELet (x, t, e', b) => 353 | ELet (x, t, e', b) =>
354 let 354 let
355 fun doSub () = #1 (reduceExp env (subExpInExp (0, e') b))
356
355 fun trySub () = 357 fun trySub () =
356 case e' of 358 case t of
357 (ECase _, _) => e 359 (TFfi ("Basis", "string"), _) => doSub ()
358 | _ => #1 (reduceExp env (subExpInExp (0, e') b)) 360 | _ =>
361 case e' of
362 (ECase _, _) => e
363 | _ => doSub ()
359 in 364 in
360 if impure e' then 365 if impure e' then
361 let 366 let
362 val effs_e' = summarize 0 e' 367 val effs_e' = summarize 0 e'
363 val effs_b = summarize 0 b 368 val effs_b = summarize 0 b