Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/smlnj-lib/Util/int-binary-set.sml
ViewVC logotype

Diff of /sml/trunk/src/smlnj-lib/Util/int-binary-set.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 815, Fri May 4 05:09:10 2001 UTC revision 816, Fri May 4 16:37:36 2001 UTC
# Line 402  Line 402 
402            foldl (fn (item, s) => if (pred item) then add(s, item) else s)            foldl (fn (item, s) => if (pred item) then add(s, item) else s)
403              empty set              empty set
404    
405        fun partition pred set =
406              foldl
407                (fn (item, (s1, s2)) =>
408                    if (pred item) then (add(s1, item), s2) else (s1, add(s2, item))
409                )
410                  (empty, empty) set
411    
412      fun find p E = NONE      fun find p E = NONE
413        | find p (T{elt,left,right,...}) = (case find p left        | find p (T{elt,left,right,...}) = (case find p left
414             of NONE => if (p elt)             of NONE => if (p elt)

Legend:
Removed from v.815  
changed lines
  Added in v.816

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0