[Home] Type Microsoft.FSharp.Collections.Tagged.Map


Immutable maps. A constraint tag carries information about the key-comparer being used. If 'comparerTag is Tags.StructuralComparer then this type is the same as Set (the tag can be ignored).

Full Type Signature

type Map<'key,'a,'comparerTag when 'comparerTag :> IComparer<'key>>
  with
    interface IComparable
    interface IEnumerable
    interface IEnumerable>
    member Add : 'key * 'a -> Map<'key,'a,'comparerTag>
    member ContainsKey : 'key -> bool
    static member Create : 'comparerTag * seq<'key * 'a> -> Map<'key,'a,'comparerTag>
    static member Empty : 'comparerTag -> Map<'key,'a,'comparerTag>
    override Equals : obj -> bool
    member Exists : ('key -> 'a -> bool) -> bool
    member Filter : ('key -> 'a -> bool) -> Map<'key,'a,'comparerTag>
    [<Obsolete ("Consider using map.[key] instead")>]
    member Find : 'key -> 'a
    member First : ('key -> 'a -> 'b option) -> 'b option
    member Fold : ('key -> 'a -> 'state -> 'state) -> ('state -> 'state)
    member FoldAndMap : ('key -> 'a -> 'state -> 'b * 'state) -> ('state -> Map<'key,'b,'comparerTag> * 'state)
    member FoldSection : 'key -> ('key -> ('key -> 'a -> 'state -> 'state) -> 'state -> 'state)
    member ForAll : ('key -> 'a -> bool) -> bool
    static member FromList : 'comparerTag * ('key * 'a) list -> Map<'key,'a,'comparerTag>
    member Iterate : ('key -> 'a -> unit) -> unit
    member Map : ('key -> 'a -> 'b) -> Map<'key,'b,'comparerTag>
    member MapRange : ('a -> 'b) -> Map<'key,'b,'comparerTag>
    member Partition : ('key -> 'a -> bool) -> Map<'key,'a,'comparerTag> * Map<'key,'a,'comparerTag>
    member Remove : 'key -> Map<'key,'a,'comparerTag>
    member ToArray : unit -> ('key * 'a) array
    member ToList : unit -> ('key * 'a) list
    member TryFind : 'key -> 'a option
    member Count : int
    member IsEmpty : bool
    member Item : 'key -> 'a with get
  end

Instance Members

MemberDescription
member Add : 'key * 'a -> Map<'key,'a,'comparerTag>
Return a new map with the binding added to the given map.
member ContainsKey : 'key -> bool
Test is an element is in the domain of the map
member Count : int
The number of bindings in the map
override Equals : obj -> bool
member Exists : ('key -> 'a -> bool) -> bool
Return true if the given predicate returns true for one of the bindings in the map. Always returns false if the map is empty.
member Filter : ('key -> 'a -> bool) -> Map<'key,'a,'comparerTag>
Build a new map containing the bindings for which the given predicate returns 'true'.
member First : ('key -> 'a -> 'b option) -> 'b option
Search the map looking for the first element where the given function returns a [[Some]] value
member Fold : ('key -> 'a -> 'state -> 'state) -> ('state -> 'state)
Fold over the bindings in the map.
member
  FoldAndMap : ('key -> 'a -> 'state -> 'b * 'state) ->
               ('state -> Map<'key,'b,'comparerTag> * 'state)
Fold over the bindings in the map.
member
  FoldSection : 'key ->
                ('key -> ('key -> 'a -> 'state -> 'state) -> 'state -> 'state)
Given the start and end points of a key range, Fold over the bindings in the map that are in the range, and the end points are included if present (the range is considered a closed interval).
member ForAll : ('key -> 'a -> bool) -> bool
Return true if the given predicate returns true for all of the bindings in the map. Always returns true if the map is empty.
member IsEmpty : bool
Return true if there are no bindings in the map.
member Item : 'key -> 'a with get
Lookup an element in the map, raising [[Not_found]]/[[KeyNotFoundException]] if no binding exists in the map.
member Iterate : ('key -> 'a -> unit) -> unit
Apply the given function to each binding in the dictionary
member Map : ('key -> 'a -> 'b) -> Map<'key,'b,'comparerTag>
Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. The index passed to the function indicates the index of element being transformed.
member MapRange : ('a -> 'b) -> Map<'key,'b,'comparerTag>
Build a new collection whose elements are the results of applying the given function to each of the elements of the collection.
member
  Partition : ('key -> 'a -> bool) ->
              Map<'key,'a,'comparerTag> * Map<'key,'a,'comparerTag>
Build two new maps, one containing the bindings for which the given predicate returns 'true', and the other the remaining bindings.
member Remove : 'key -> Map<'key,'a,'comparerTag>
Remove an element from the domain of the map. No exception is raised if the element is not present.
member ToArray : unit -> ('key * 'a) array
The elements of the set as an array
member ToList : unit -> ('key * 'a) list
The elements of the set as a list.
member TryFind : 'key -> 'a option
Lookup an element in the map, returning a [[Some]] value if the element is in the domain of the map and [[None]] if not.

Static Members

MemberDescription
member Create : 'comparerTag * seq<'key * 'a> -> Map<'key,'a,'comparerTag>
Build a map that contains the bindings of the given IEnumerable and where comparison of elements is based on the given comparison function
member Empty : 'comparerTag -> Map<'key,'a,'comparerTag>
The empty map, and use the given comparer comparison function for all operations associated with any maps built from this map.
member FromList : 'comparerTag * ('key * 'a) list -> Map<'key,'a,'comparerTag>

Deprecated Members

MemberDescription
[<Obsolete ("Consider using map.[key] instead")>]
member Find : 'key -> 'a

Note: Consider using map.[key] instead

See Also

Microsoft.FSharp.Collections.Tagged


Documentation for assembly FSharp.Core, version 1.9.4.19, generated using F# version 1.9.4.19