comparison src/mono_util.sml @ 919:cc956020801b

'more' demos working after optimizer fix
author Adam Chlipala <adamc@hcoop.net>
date Tue, 08 Sep 2009 19:42:12 -0400
parents 8e540df3294d
children dfe34fad749d
comparison
equal deleted inserted replaced
918:6a77c3e33908 919:cc956020801b
429 exp = fn e => fn () => 429 exp = fn e => fn () =>
430 if exp e then 430 if exp e then
431 S.Return () 431 S.Return ()
432 else 432 else
433 S.Continue (e, ())} k () of 433 S.Continue (e, ())} k () of
434 S.Return _ => true
435 | S.Continue _ => false
436
437 fun existsB {typ, exp, bind} ctx e =
438 case mapfoldB {typ = fn t => fn () =>
439 if typ t then
440 S.Return ()
441 else
442 S.Continue (t, ()),
443 exp = fn ctx => fn e => fn () =>
444 if exp (ctx, e) then
445 S.Return ()
446 else
447 S.Continue (e, ()),
448 bind = bind} ctx e () of
434 S.Return _ => true 449 S.Return _ => true
435 | S.Continue _ => false 450 | S.Continue _ => false
436 451
437 fun foldB {typ, exp, bind} ctx s e = 452 fun foldB {typ, exp, bind} ctx s e =
438 case mapfoldB {typ = fn t => fn s => S.Continue (t, typ (t, s)), 453 case mapfoldB {typ = fn t => fn s => S.Continue (t, typ (t, s)),