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/binary-set-fn.sml
ViewVC logotype

Diff of /sml/trunk/src/smlnj-lib/Util/binary-set-fn.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 396  Line 396 
396            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)
397              empty set              empty set
398    
399        fun partition pred set =
400              foldl
401                (fn (item, (s1, s2)) =>
402                    if (pred item) then (add(s1, item), s2) else (s1, add(s2, item))
403                )
404                  (empty, empty) set
405    
406      fun find p E = NONE      fun find p E = NONE
407        | find p (T{elt,left,right,...}) = (case find p left        | find p (T{elt,left,right,...}) = (case find p left
408             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