A Map is a collection that maps keys to values. Hash maps require keys that correctly support GetHashCode and Equals. Hash maps provide fast access (log32N hops). count is O(1).
More details can be found in the API docs.
open FSharpx.Collections
// Create a new HashMap and add some items to it
let m =
PersistentHashMap.empty
|> PersistentHashMap.add 42 "hello"
|> PersistentHashMap.add 99 "world"
seq [(99, "world"); (42, "hello")]
|
// lookup some items
PersistentHashMap.find 42 m
PersistentHashMap.find 99 m
m.[99]
// Check no. of elements in the HashMap
PersistentHashMap.length m
PersistentHashMaps are immutable and therefor allow to create new version without destruction of the old ones.
let m' =
m
|> PersistentHashMap.add 104 "!"
|> PersistentHashMap.add 42 "hi" // replace existing value
PersistentHashMap.find 42 m'
PersistentHashMap.find 104 m'
PersistentHashMap.find 42 m
PersistentHashMap.length m
PersistentHashMap.length m'
// remove an element
let m'' =
m' |> PersistentHashMap.remove 104
PersistentHashMap.length m''
There a couple of interesting operations on HashMaps:
// Convert a sequence of key value pairs to a HashMap
let stringBasedMap =
PersistentHashMap.ofSeq [("a",1); ("b",2); ("c",3); ("d",4); ("e",5)]
seq [("e", 5); ("a", 1); ("b", 2); ("c", 3); ...]
|
// Square all values in a HashMap
let stringBasedMap' =
PersistentHashMap.map (fun x -> x * x) stringBasedMap
stringBasedMap'.["d"]
A Map is a collection that maps keys to values. Hash maps require keys that correctly support GetHashCode and Equals. Hash maps provide fast access (log32N hops). Count is O(1).
// Create an empty PersistentHashMap and add some elements
PersistentHashMap<int,string> map =
PersistentHashMap<int, string>.Empty()
.Add(42,"hello")
.Add(99, "world");
Console.WriteLine(map[42]); // hello
Console.WriteLine(map[99]); // world
// Check no. of elements in the PersistentHashMap
Console.WriteLine(map.Length); // 2
|
PersistentHashMaps are immutable and therefor allow to create new version without destruction of the old ones.
PersistentHashMap<int, string> map2 =
map
.Add(104, "!")
.Add(42, "hi"); // replace existing value
Console.WriteLine(map2[42]); // hi
Console.WriteLine(map[42]); // hello
Console.WriteLine(map.Length); // 2
Console.WriteLine(map2.Length); // 3
// remove the last element from a PersistentHashMap
PersistentHashMap<int, string> map3 = map2.Remove(104);
Console.WriteLine(map3.Length); // 2
|
Bulk operations on HashMaps use an internal TransientHashMap in order to get much better performance. The following scripts shows this:
open FSharpx.Collections
let trials = 5
let r = new System.Random()
let initFSharpMapAndPersistentMapFromList n =
sprintf "Init with n = %d" n |> printInFsiTags
let list = List.sortBy snd [for i in 1..n -> i,r.Next().ToString()]
averageTime trials " FSharp.Map.ofSeq"
(fun () -> Map.ofSeq list)
let initPersistentHashMap list =
let m = ref PersistentHashMap.empty
for (key,value) in list do
m := PersistentHashMap.add key value !m
!m
averageTime trials " Multiple PersistentHashMap.add"
(fun () -> initPersistentHashMap list)
averageTime trials " PersistentHashMap.ofSeq"
(fun () -> PersistentHashMap.ofSeq list)
let initImmutableDictionary list =
let d = ref (System.Collections.Immutable.ImmutableDictionary<int,string>.Empty)
for (key,value) in list do
d := (!d).Add(key,value)
!d
averageTime trials " Multiple ImmutableDictionay.add"
(fun () -> initImmutableDictionary list)
let initImmutableDictionary list =
let d = ref (System.Collections.Immutable.ImmutableSortedDictionary<int,string>.Empty)
for (key,value) in list do
d := (!d).Add(key,value)
!d
averageTime trials " Multiple ImmutableSortedDictionay.add"
(fun () -> initImmutableDictionary list)
let lookupInFSharpMapAndPersistentMap n count =
sprintf "%d Lookups in size n = %d" count n |> printInFsiTags
let list = [for i in 0..n-1 -> i.ToString(),r.Next()]
let fsharpMap = Map.ofSeq list
let map = PersistentHashMap.ofSeq list
averageTime trials " FSharp.Map"
(fun () -> for i in 1..count do fsharpMap.[r.Next(n).ToString()])
averageTime trials " PersistentHashMap"
(fun () -> for i in 1..count do map.[r.Next(n).ToString()])
let dict =
let d = ref (System.Collections.Immutable.ImmutableDictionary<string,int>.Empty)
for (key,value) in list do
d := (!d).Add(key,value)
!d
averageTime trials " ImmutableDictionay"
(fun () -> for i in 1..count do dict.[r.Next(n).ToString()])
let dict' =
let d = ref (System.Collections.Immutable.ImmutableSortedDictionary<string,int>.Empty)
for (key,value) in list do
d := (!d).Add(key,value)
!d
averageTime trials " ImmutableSortedDictionay"
(fun () -> for i in 1..count do dict'.[r.Next(n).ToString()])
initFSharpMapAndPersistentMapFromList 10000
initFSharpMapAndPersistentMapFromList 100000
initFSharpMapAndPersistentMapFromList 1000000
[fsi:Init with n = 10000]
[fsi: FSharp.Map.ofSeq 6.4ms]
[fsi: Multiple PersistentHashMap.add 10.6ms]
[fsi: PersistentHashMap.ofSeq 10.4ms]
[fsi: Multiple ImmutableDictionay.add 22.6ms]
[fsi: Multiple ImmutableSortedDictionay.add 18.8ms]
[fsi:Init with n = 100000]
[fsi: FSharp.Map.ofSeq 140.8ms]
[fsi: Multiple PersistentHashMap.add 184.4ms]
[fsi: PersistentHashMap.ofSeq 128.2ms]
[fsi: Multiple ImmutableDictionay.add 253.0ms]
[fsi: Multiple ImmutableSortedDictionay.add 174.4ms]
[fsi:Init with n = 1000000]
[fsi: FSharp.Map.ofSeq 2798.2ms]
[fsi: Multiple PersistentHashMap.add 3459.0ms]
[fsi: PersistentHashMap.ofSeq 3071.0ms]
[fsi: Multiple ImmutableDictionay.add 4585.0ms]
[fsi: Multiple ImmutableSortedDictionay.add 3240.0ms]
|
lookupInFSharpMapAndPersistentMap 10000 10000
lookupInFSharpMapAndPersistentMap 100000 10000
lookupInFSharpMapAndPersistentMap 1000000 10000
[fsi:10000 Lookups in size n = 10000]
[fsi: FSharp.Map 3.0ms]
[fsi: PersistentHashMap 2.0ms]
[fsi: ImmutableDictionay 2.2ms]
[fsi: ImmutableSortedDictionay 12.0ms]
[fsi:10000 Lookups in size n = 100000]
[fsi: FSharp.Map 4.8ms]
[fsi: PersistentHashMap 3.4ms]
[fsi: ImmutableDictionay 2.8ms]
[fsi: ImmutableSortedDictionay 15.2ms]
[fsi:10000 Lookups in size n = 1000000]
[fsi: FSharp.Map 9.4ms]
[fsi: PersistentHashMap 6.0ms]
[fsi: ImmutableDictionay 6.4ms]
[fsi: ImmutableSortedDictionay 23.6ms]
|
namespace System
namespace FSharpx
namespace FSharpx.Collections
val m : PersistentHashMap<int,string>
Multiple items
module PersistentHashMap
from FSharpx.Collections
<summary>
Defines functions which allow to access and manipulate PersistentHashMaps.
</summary>
--------------------
type PersistentHashMap<'T,'S (requires equality and equality)> =
interface IReadOnlyCollection<'T * 'S>
interface IEnumerable
interface IEnumerable<'T * 'S>
private new : count':int * root':INode * hasNull':bool * nullValue':'S -> PersistentHashMap<'T,'S>
val private count: int
val private root: INode
val private hasNull: bool
val private nullValue: 'S
member Add : key:'T * value:'S -> PersistentHashMap<'T,'S>
member ContainsKey : key:'T -> bool
...
<summary>
A Map is a collection that maps keys to values. Hash maps require keys that correctly support GetHashCode and Equals.
Hash maps provide fast access (log32N hops). count is O(1).
</summary>
val empty<'T,'S (requires equality and equality)> : PersistentHashMap<'T,'S> (requires equality and equality)
<summary>
O(1), returns an empty PersistentHashMap
</summary>
val add : key:'T -> value:'S -> map:PersistentHashMap<'T,'S> -> PersistentHashMap<'T,'S> (requires equality and equality)
<summary>
O(log32n), adds an element to the map
</summary>
val find : key:'T -> map:PersistentHashMap<'T,'S> -> 'S (requires equality and equality)
<summary>
O(log32n), returns the value if the exists in the map
</summary>
val length : map:PersistentHashMap<'T,'S> -> int (requires equality and equality)
<summary>
O(1), returns the count of the elements in the PersistentHashMap (same as count)
</summary>
val m' : PersistentHashMap<int,string>
val m'' : PersistentHashMap<int,string>
val remove : key:'T -> map:PersistentHashMap<'T,'S> -> PersistentHashMap<'T,'S> (requires equality and equality)
<summary>
O(log32n), removes the element with the given key from the map
</summary>
val stringBasedMap : PersistentHashMap<string,int>
Multiple items
val ofSeq : items:seq<'T * 'S> -> PersistentHashMap<'T,'S> (requires equality and equality)
<summary>
O(n). Returns a HashMap of the seq.
</summary>
--------------------
static member PersistentHashMap.ofSeq : items:seq<'T * 'S> -> PersistentHashMap<'T,'S>
val stringBasedMap' : PersistentHashMap<string,int>
val map : f:('S -> 'S1) -> map:PersistentHashMap<'T,'S> -> PersistentHashMap<'T,'S1> (requires equality and equality and equality)
<summary>
O(n). Returns a HashMap whose elements are the results of applying the supplied function to each of the elements of a supplied HashMap.
</summary>
val x : int
val stopTime : f:(unit -> 'a) -> 'a * float
Stops the runtime for a given function
val f : (unit -> 'a)
val sw : Diagnostics.Stopwatch
namespace System.Diagnostics
Multiple items
type Stopwatch =
new : unit -> unit
member Reset : unit -> unit
member Restart : unit -> unit
member Start : unit -> unit
member Stop : unit -> unit
static member GetTimestamp : unit -> int64
static member StartNew : unit -> Stopwatch
static val Frequency : int64
static val IsHighResolution : bool
member Elapsed : TimeSpan
...
<summary>Provides a set of methods and properties that you can use to accurately measure elapsed time.</summary>
--------------------
Diagnostics.Stopwatch() : Diagnostics.Stopwatch
Diagnostics.Stopwatch.Start() : unit
val result : 'a
Diagnostics.Stopwatch.Stop() : unit
Multiple items
val float : value:'T -> float (requires member op_Explicit)
<summary>Converts the argument to 64-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using <c>Double.Parse()</c>
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.</summary>
<param name="value">The input value.</param>
<returns>The converted float</returns>
--------------------
[<Struct>]
type float = Double
<summary>An abbreviation for the CLI type <see cref="T:System.Double" />.</summary>
<category>Basic Types</category>
--------------------
type float<'Measure> =
float
<summary>The type of double-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
<see cref="T:System.Double" />.</summary>
<category index="6">Basic Types with Units of Measure</category>
property Diagnostics.Stopwatch.ElapsedMilliseconds: int64 with get
<summary>Gets the total elapsed time measured by the current instance, in milliseconds.</summary>
<returns>A read-only long integer representing the total number of milliseconds measured by the current instance.</returns>
val stopAverageTime : count:int -> f:(unit -> 'a) -> float
Stops the average runtime for a given function and applies it the given count
val count : int
type GC =
static member AddMemoryPressure : bytesAllocated: int64 -> unit
static member AllocateArray<'T> : length: int *?pinned: bool -> 'T []
static member AllocateUninitializedArray<'T> : length: int *?pinned: bool -> 'T []
static member CancelFullGCNotification : unit -> unit
static member Collect : unit -> unit + 4 overloads
static member CollectionCount : generation: int -> int
static member EndNoGCRegion : unit -> unit
static member GetAllocatedBytesForCurrentThread : unit -> int64
static member GetGCMemoryInfo : unit -> GCMemoryInfo + 1 overload
static member GetGeneration : obj: obj -> int + 1 overload
...
<summary>Controls the system garbage collector, a service that automatically reclaims unused memory.</summary>
GC.Collect() : unit
GC.Collect(generation: int) : unit
GC.Collect(generation: int, mode: GCCollectionMode) : unit
GC.Collect(generation: int, mode: GCCollectionMode, blocking: bool) : unit
GC.Collect(generation: int, mode: GCCollectionMode, blocking: bool, compacting: bool) : unit
val ignore : value:'T -> unit
<summary>Ignore the passed value. This is often used to throw away results of a computation.</summary>
<param name="value">The value to ignore.</param>
val printInFsiTags : s:string -> unit
val s : string
val printfn : format:Printf.TextWriterFormat<'T> -> 'T
<summary>Print to <c>stdout</c> using the given format, and add a newline.</summary>
<param name="format">The formatter.</param>
<returns>The formatted result.</returns>
val averageTime : count:int -> desc:string -> f:(unit -> 'a) -> unit
Stops the average runtime for a given function and applies it the given count
Afterwards it reports it with the given description
val desc : string
val time : float
val sprintf : format:Printf.StringFormat<'T> -> 'T
<summary>Print to a string using the given format.</summary>
<param name="format">The formatter.</param>
<returns>The formatted result.</returns>
val trials : int
val r : Random
Multiple items
type Random =
new : unit -> unit + 1 overload
member Next : unit -> int + 2 overloads
member NextBytes : buffer: byte [] -> unit + 1 overload
member NextDouble : unit -> float
member Sample : unit -> float
<summary>Represents a pseudo-random number generator, which is an algorithm that produces a sequence of numbers that meet certain statistical requirements for randomness.</summary>
--------------------
Random() : Random
Random(Seed: int) : Random
val initFSharpMapAndPersistentMapFromList : n:int -> unit
val n : int
Multiple items
val list : (int * string) list
--------------------
type 'T list = List<'T>
<summary>The type of immutable singly-linked lists. </summary>
<remarks>See the <see cref="T:Microsoft.FSharp.Collections.ListModule" /> module for further operations related to lists.
Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1; 2; 3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/lists">F# Language Guide - Lists</a>.
</remarks>
Multiple items
module List
from FSharpx.Collections
<summary>
Extensions for F#'s List module.
</summary>
--------------------
module List
from Microsoft.FSharp.Collections
<summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.list`1" />.</summary>
<namespacedoc><summary>Operations for collections such as lists, arrays, sets, maps and sequences. See also
<a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/fsharp-collection-types">F# Collection Types</a> in the F# Language Guide.
</summary></namespacedoc>
--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IReadOnlyList<'T>
interface IReadOnlyCollection<'T>
interface IEnumerable
interface IEnumerable<'T>
member GetReverseIndex : rank:int * offset:int -> int
member GetSlice : startIndex:int option * endIndex:int option -> 'T list
static member Cons : head:'T * tail:'T list -> 'T list
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
...
<summary>The type of immutable singly-linked lists.</summary>
<remarks>Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1;2;3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
</remarks>
<exclude />
val sortBy : projection:('T -> 'Key) -> list:'T list -> 'T list (requires comparison)
<summary>Sorts the given list using keys given by the given projection. Keys are compared using <see cref="M:Microsoft.FSharp.Core.Operators.compare" />.</summary>
<remarks>This is a stable sort, i.e. the original order of equal elements is preserved.</remarks>
<param name="projection">The function to transform the list elements into the type to be compared.</param>
<param name="list">The input list.</param>
<returns>The sorted list.</returns>
val snd : tuple:('T1 * 'T2) -> 'T2
<summary>Return the second element of a tuple, <c>snd (a,b) = b</c>.</summary>
<param name="tuple">The input tuple.</param>
<returns>The second value.</returns>
val i : int
Random.Next() : int
Random.Next(maxValue: int) : int
Random.Next(minValue: int, maxValue: int) : int
Multiple items
module Map
from FSharpx.Collections
<summary>
Extensions for F#'s Map module.
</summary>
--------------------
module Map
from Microsoft.FSharp.Collections
<summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.Map`2" />.</summary>
--------------------
type Map<'Key,'Value (requires comparison)> =
interface IReadOnlyDictionary<'Key,'Value>
interface IReadOnlyCollection<KeyValuePair<'Key,'Value>>
interface IEnumerable
interface IComparable
interface IEnumerable<KeyValuePair<'Key,'Value>>
interface ICollection<KeyValuePair<'Key,'Value>>
interface IDictionary<'Key,'Value>
new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
member Add : key:'Key * value:'Value -> Map<'Key,'Value>
member Change : key:'Key * f:('Value option -> 'Value option) -> Map<'Key,'Value>
...
<summary>Immutable maps based on binary trees, where keys are ordered by F# generic comparison. By default
comparison is the F# structural comparison function or uses implementations of the IComparable interface on key values.</summary>
<remarks>See the <see cref="T:Microsoft.FSharp.Collections.MapModule" /> module for further operations on maps.
All members of this class are thread-safe and may be used concurrently from multiple threads.</remarks>
--------------------
new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
val ofSeq : elements:seq<'Key * 'T> -> Map<'Key,'T> (requires comparison)
<summary>Returns a new map made from the given bindings.</summary>
<param name="elements">The input sequence of key/value pairs.</param>
<returns>The resulting map.</returns>
val initPersistentHashMap : (seq<'a * 'b> -> PersistentHashMap<'a,'b>) (requires equality and equality)
Multiple items
val list : seq<'a * 'b> (requires equality and equality)
--------------------
type 'T list = List<'T>
<summary>The type of immutable singly-linked lists. </summary>
<remarks>See the <see cref="T:Microsoft.FSharp.Collections.ListModule" /> module for further operations related to lists.
Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1; 2; 3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/lists">F# Language Guide - Lists</a>.
</remarks>
val m : PersistentHashMap<'a,'b> ref (requires equality and equality)
Multiple items
val ref : value:'T -> 'T ref
<summary>Create a mutable reference cell</summary>
<param name="value">The value to contain in the cell.</param>
<returns>The created reference cell.</returns>
--------------------
type 'T ref = Ref<'T>
<summary>The type of mutable references. Use the functions [!] and [:=] to get and
set values of this type.</summary>
<category>Basic Types</category>
val key : 'a (requires equality)
val value : 'b (requires equality)
val initImmutableDictionary : (seq<int * string> -> Collections.Immutable.ImmutableDictionary<int,string>)
Multiple items
val list : seq<int * string>
--------------------
type 'T list = List<'T>
<summary>The type of immutable singly-linked lists. </summary>
<remarks>See the <see cref="T:Microsoft.FSharp.Collections.ListModule" /> module for further operations related to lists.
Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1; 2; 3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/lists">F# Language Guide - Lists</a>.
</remarks>
val d : Collections.Immutable.ImmutableDictionary<int,string> ref
namespace System.Collections
namespace System.Collections.Immutable
Multiple items
type ImmutableDictionary<'TKey,'TValue> =
interface ICollection<KeyValuePair<'TKey,'TValue>>
interface IEnumerable<KeyValuePair<'TKey,'TValue>>
interface IEnumerable
interface IDictionary<'TKey,'TValue>
interface IReadOnlyCollection<KeyValuePair<'TKey,'TValue>>
interface IReadOnlyDictionary<'TKey,'TValue>
interface ICollection
interface IDictionary
interface IImmutableDictionary<'TKey,'TValue>
new : unit -> unit
...
<summary>Represents an immutable, unordered collection of keys and values.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)</summary>
<typeparam name="TKey">The type of the keys in the dictionary.</typeparam>
<typeparam name="TValue">The type of the values in the dictionary.</typeparam>
--------------------
type ImmutableDictionary =
static member Contains<'TKey,'TValue> : map: IImmutableDictionary<'TKey,'TValue> * key: 'TKey * value: 'TValue -> bool
static member Create<'TKey,'TValue> : unit -> ImmutableDictionary<'TKey,'TValue> + 2 overloads
static member CreateBuilder<'TKey,'TValue> : unit -> Builder<'TKey,'TValue> + 2 overloads
static member CreateRange<'TKey,'TValue> : items: IEnumerable<KeyValuePair<'TKey,'TValue>> -> ImmutableDictionary<'TKey,'TValue> + 2 overloads
static member GetValueOrDefault<'TKey,'TValue> : dictionary: IImmutableDictionary<'TKey,'TValue> * key: 'TKey -> 'TValue + 1 overload
static member ToImmutableDictionary<'TKey,'TValue> : source: IEnumerable<KeyValuePair<'TKey,'TValue>> -> ImmutableDictionary<'TKey,'TValue> + 8 overloads
<summary>Provides a set of initialization methods for instances of the <see cref="T:System.Collections.Immutable.ImmutableDictionary`2" /> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)</summary>
Multiple items
val int : value:'T -> int (requires member op_Explicit)
<summary>Converts the argument to signed 32-bit integer. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using <c>Int32.Parse()</c>
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.</summary>
<param name="value">The input value.</param>
<returns>The converted int</returns>
--------------------
[<Struct>]
type int = int32
<summary>An abbreviation for the CLI type <see cref="T:System.Int32" />.</summary>
<category>Basic Types</category>
--------------------
type int<'Measure> =
int
<summary>The type of 32-bit signed integer numbers, annotated with a unit of measure. The unit
of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
<see cref="T:System.Int32" />.</summary>
<category>Basic Types with Units of Measure</category>
Multiple items
val string : value:'T -> string
<summary>Converts the argument to a string using <c>ToString</c>.</summary>
<remarks>For standard integer and floating point values the and any type that implements <c>IFormattable</c><c>ToString</c> conversion uses <c>CultureInfo.InvariantCulture</c>. </remarks>
<param name="value">The input value.</param>
<returns>The converted string.</returns>
--------------------
type string = String
<summary>An abbreviation for the CLI type <see cref="T:System.String" />.</summary>
<category>Basic Types</category>
val key : int
val value : string
val initImmutableDictionary : (seq<int * string> -> Collections.Immutable.ImmutableSortedDictionary<int,string>)
val d : Collections.Immutable.ImmutableSortedDictionary<int,string> ref
Multiple items
type ImmutableSortedDictionary<'TKey,'TValue> =
interface ICollection<KeyValuePair<'TKey,'TValue>>
interface IEnumerable<KeyValuePair<'TKey,'TValue>>
interface IEnumerable
interface IDictionary<'TKey,'TValue>
interface IReadOnlyCollection<KeyValuePair<'TKey,'TValue>>
interface IReadOnlyDictionary<'TKey,'TValue>
interface ICollection
interface IDictionary
interface IImmutableDictionary<'TKey,'TValue>
new : unit -> unit
...
<summary>Represents an immutable sorted dictionary.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)</summary>
<typeparam name="TKey">The type of the key contained in the dictionary.</typeparam>
<typeparam name="TValue">The type of the value contained in the dictionary.</typeparam>
--------------------
type ImmutableSortedDictionary =
static member Create<'TKey,'TValue> : unit -> ImmutableSortedDictionary<'TKey,'TValue> + 2 overloads
static member CreateBuilder<'TKey,'TValue> : unit -> Builder<'TKey,'TValue> + 2 overloads
static member CreateRange<'TKey,'TValue> : keyComparer: IComparer<'TKey> * items: IEnumerable<KeyValuePair<'TKey,'TValue>> -> ImmutableSortedDictionary<'TKey,'TValue> + 2 overloads
static member ToImmutableSortedDictionary<'TKey,'TValue> : source: IEnumerable<KeyValuePair<'TKey,'TValue>> -> ImmutableSortedDictionary<'TKey,'TValue> + 6 overloads
<summary>Provides a set of initialization methods for instances of the <see cref="T:System.Collections.Immutable.ImmutableSortedDictionary`2" /> class.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)</summary>
val lookupInFSharpMapAndPersistentMap : n:int -> count:int -> unit
Multiple items
val list : (string * int) list
--------------------
type 'T list = List<'T>
<summary>The type of immutable singly-linked lists. </summary>
<remarks>See the <see cref="T:Microsoft.FSharp.Collections.ListModule" /> module for further operations related to lists.
Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1; 2; 3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/lists">F# Language Guide - Lists</a>.
</remarks>
Int32.ToString() : string
Int32.ToString(format: string) : string
Int32.ToString(provider: IFormatProvider) : string
Int32.ToString(format: string, provider: IFormatProvider) : string
val fsharpMap : Map<string,int>
val map : PersistentHashMap<string,int>
val i : int32
val dict : Collections.Immutable.ImmutableDictionary<string,int>
val d : Collections.Immutable.ImmutableDictionary<string,int> ref
val key : string
val value : int
val dict' : Collections.Immutable.ImmutableSortedDictionary<string,int>
val d : Collections.Immutable.ImmutableSortedDictionary<string,int> ref