TEXT   62

ord map

Guest on 15th May 2022 04:30:59 AM

  1.  type 'a map
  2.  
  3. val empty : 'a map
  4.  
  5.     The empty map
  6.  
  7.  
  8. val insert : 'a map * Key.ord_key * 'a -> 'a map
  9.  
  10. val insert' : ((Key.ord_key * 'a) * 'a map) -> 'a map
  11.  
  12.     Insert an item.
  13.  
  14.  
  15. val find : 'a map * Key.ord_key -> 'a option
  16.  
  17.     Look for an item, return NONE if the item doesn't exist
  18.  
  19.  
  20. val remove : 'a map * Key.ord_key -> 'a map * 'a
  21.  
  22.     Remove an item, returning new map and value removed.
  23.     Raises LibBase.NotFound if not found.
  24.  
  25. val numItems : 'a map -> int
  26.  
  27.     Return the number of items in the map
  28.  
  29.  
  30. val listItems : 'a map -> 'a list
  31.  
  32. val listItemsi : 'a map -> (Key.ord_key * 'a) list
  33.  
  34.     Return an ordered list of the items (and their keys) in the map.
  35.  
  36. val collate : ('a * 'a -> order) -> ('a map * 'a map) -> order
  37.  
  38.     given an ordering on the map's range, return an ordering
  39.     on the map.
  40.  
  41. val unionWith : ('a * 'a -> 'a) -> ('a map * 'a map) -> 'a map
  42.  
  43. val unionWithi : (Key.ord_key * 'a * 'a -> 'a) -> ('a map * 'a map) -> 'a map
  44.  
  45.     return a map whose domain is the union of the domains of the two input
  46.     maps, using the supplied function to define the map on elements that
  47.     are in both domains.
  48.  
  49. val intersectWith : ('a * 'b -> 'c) -> ('a map * 'b map) -> 'c map
  50.  
  51. val intersectWithi : (Key.ord_key * 'a * 'b -> 'c) -> ('a map * 'b map) -> 'c map
  52.  
  53.     return a map whose domain is the intersection of the domains of the
  54.     two input maps, using the supplied function to define the range.
  55.  
  56. val app : ('a -> unit) -> 'a map -> unit
  57.  
  58. val appi : ((Key.ord_key * 'a) -> unit) -> 'a map -> unit
  59.  
  60.     Apply a function to the entries of the map in map order.
  61.  
  62.  
  63. val map : ('a -> 'b) -> 'a map -> 'b map
  64.  
  65. val mapi : (Key.ord_key * 'a -> 'b) -> 'a map -> 'b map
  66.  
  67.     Create a new map by applying a map function to the
  68.               name/value pairs in the map.
  69.  
  70. val foldl : ('a * 'b -> 'b) -> 'b -> 'a map -> 'b
  71.  
  72. val foldli : (Key.ord_key * 'a * 'b -> 'b) -> 'b -> 'a map -> 'b
  73.  
  74.     Apply a folding function to the entries of the map
  75.               in increasing map order.
  76.  
  77. val foldr : ('a * 'b -> 'b) -> 'b -> 'a map -> 'b
  78.  
  79. val foldri : (Key.ord_key * 'a * 'b -> 'b) -> 'b -> 'a map -> 'b
  80.  
  81.     Apply a folding function to the entries of the map
  82.               in decreasing map order.
  83.  
  84. val filter : ('a -> bool) -> 'a map -> 'a map
  85.  
  86. val filteri : (Key.ord_key * 'a -> bool) -> 'a map -> 'a map
  87.  
  88.     Filter out those elements of the map that do not satisfy the
  89.     predicate.  The filtering is done in increasing map order.
  90.  
  91. val mapPartial : ('a -> 'b option) -> 'a map -> 'b map
  92.  
  93. val mapPartiali : (Key.ord_key * 'a -> 'b option) -> 'a map -> 'b map
  94.  
  95.     map a partial function over the elements of a map in increasing
  96.     map order.

Raw Paste


Login or Register to edit or fork this paste. It's free.