Mercurial > urweb
comparison src/core_util.sml @ 1185:338be96f8533
Undo an Especialize change that turned out to be unecessary
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 16 Mar 2010 10:09:01 -0400 |
parents | 0657e5adc938 |
children | c316ca3c9ec6 |
comparison
equal
deleted
inserted
replaced
1184:d6f0e972b706 | 1185:338be96f8533 |
---|---|
1 (* Copyright (c) 2008, Adam Chlipala | 1 (* Copyright (c) 2008-2010, Adam Chlipala |
2 * All rights reserved. | 2 * All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
370 con = fn c => fn () => | 370 con = fn c => fn () => |
371 if con c then | 371 if con c then |
372 S.Return () | 372 S.Return () |
373 else | 373 else |
374 S.Continue (c, ())} k () of | 374 S.Continue (c, ())} k () of |
375 S.Return _ => true | |
376 | S.Continue _ => false | |
377 | |
378 fun existsB {kind, con, bind} ctx c = | |
379 case mapfoldB {kind = fn ctx => fn k => fn () => | |
380 if kind (ctx, k) then | |
381 S.Return () | |
382 else | |
383 S.Continue (k, ()), | |
384 con = fn ctx => fn c => fn () => | |
385 if con (ctx, c) then | |
386 S.Return () | |
387 else | |
388 S.Continue (c, ()), | |
389 bind = bind} ctx c () of | |
375 S.Return _ => true | 390 S.Return _ => true |
376 | S.Continue _ => false | 391 | S.Continue _ => false |
377 | 392 |
378 fun foldMap {kind, con} s c = | 393 fun foldMap {kind, con} s c = |
379 case mapfold {kind = fn k => fn s => S.Continue (kind (k, s)), | 394 case mapfold {kind = fn k => fn s => S.Continue (kind (k, s)), |