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 /smlnj-lib/branches/rt-transition/Util/ord-map-sig.sml
ViewVC logotype

Diff of /smlnj-lib/branches/rt-transition/Util/ord-map-sig.sml

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

sml/trunk/src/smlnj-lib/Util/ord-map-sig.sml revision 2, Sat Oct 4 23:33:09 1997 UTC smlnj-lib/branches/rt-transition/Util/ord-map-sig.sml revision 2980, Sat Apr 12 15:01:15 2008 UTC
# Line 16  Line 16 
16      val empty : 'a map      val empty : 'a map
17          (* The empty map *)          (* The empty map *)
18    
19        val isEmpty : 'a map -> bool
20            (* Return true if and only if the map is empty *)
21    
22        val singleton : (Key.ord_key * 'a) -> 'a map
23            (* return the specified singleton map *)
24    
25      val insert : 'a map * Key.ord_key * 'a -> 'a map      val insert : 'a map * Key.ord_key * 'a -> 'a map
26        val insert' : ((Key.ord_key * 'a) * 'a map) -> 'a map
27          (* Insert an item.  *)          (* Insert an item.  *)
28    
29      val find : 'a map * Key.ord_key -> 'a option      val find : 'a map * Key.ord_key -> 'a option
30          (* Look for an item, return NONE if the item doesn't exist *)          (* Look for an item, return NONE if the item doesn't exist *)
31    
32        val lookup : 'a map * Key.ord_key -> 'a
33            (* look for an item, raise the NotFound exception if it doesn't exist *)
34    
35        val inDomain : ('a map * Key.ord_key) -> bool
36            (* return true, if the key is in the domain of the map *)
37    
38      val remove : 'a map * Key.ord_key -> 'a map * 'a      val remove : 'a map * Key.ord_key -> 'a map * 'a
39          (* Remove an item, returning new map and value removed.          (* Remove an item, returning new map and value removed.
40           * Raises LibBase.NotFound if not found.           * Raises LibBase.NotFound if not found.
41           *)           *)
42    
43        val first : 'a map -> 'a option
44        val firsti : 'a map -> (Key.ord_key * 'a) option
45            (* return the first item in the map (or NONE if it is empty) *)
46    
47      val numItems : 'a map ->  int      val numItems : 'a map ->  int
48          (* Return the number of items in the map *)          (* Return the number of items in the map *)
49    
50      val listItems  : 'a map -> 'a list      val listItems  : 'a map -> 'a list
51      val listItemsi : 'a map -> (Key.ord_key * 'a) list      val listItemsi : 'a map -> (Key.ord_key * 'a) list
52          (* Return an ordered list of the items (and their keys) in the map.          (* Return an ordered list of the items (and their keys) in the map. *)
53           *)  
54        val listKeys : 'a map -> Key.ord_key list
55            (* return an ordered list of the keys in the map. *)
56    
57      val collate : ('a * 'a -> order) -> ('a map * 'a map) -> order      val collate : ('a * 'a -> order) -> ('a map * 'a map) -> order
58          (* given an ordering on the map's range, return an ordering          (* given an ordering on the map's range, return an ordering
# Line 53  Line 72 
72           * two input maps, using the supplied function to define the range.           * two input maps, using the supplied function to define the range.
73           *)           *)
74    
75        val mergeWith : ('a option * 'b option -> 'c option)
76              -> ('a map * 'b map) -> 'c map
77        val mergeWithi : (Key.ord_key * 'a option * 'b option -> 'c option)
78              -> ('a map * 'b map) -> 'c map
79            (* merge two maps using the given function to control the merge. For
80             * each key k in the union of the two maps domains, the function
81             * is applied to the image of the key under the map.  If the function
82             * returns SOME y, then (k, y) is added to the resulting map.
83             *)
84    
85      val app  : ('a -> unit) -> 'a map -> unit      val app  : ('a -> unit) -> 'a map -> unit
86      val appi : ((Key.ord_key * 'a) -> unit) -> 'a map -> unit      val appi : ((Key.ord_key * 'a) -> unit) -> 'a map -> unit
87          (* Apply a function to the entries of the map in map order. *)          (* Apply a function to the entries of the map in map order. *)

Legend:
Removed from v.2  
changed lines
  Added in v.2980

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