Logo Dicts

ExtensionsIDictionary Module

Provides Extensions for IDictionary<'K,'V> interface. Such as Items as key value tuples , Pop(key) or GetValue with nicer error message)

Type extensions

Type extension Description

this.AsString

Full Usage: this.AsString

Parameters:
    () : unit

Returns: string

A string representation of the IDictionary including the count of entries, the first 5 entries and the last entry.

Extended Type: IDictionary

() : unit
Returns: string

this.DoesNotContainKey

Full Usage: this.DoesNotContainKey

Parameters:
    key : 'TKey - The key to look for.

Returns: bool

Determines whether the Dictionary does not contain the specified key. Same as not(dic.ContainsKey(key))

Extended Type: IDictionary

key : 'TKey

The key to look for.

Returns: bool

this.GetValue

Full Usage: this.GetValue

Parameters:
    k : 'TKey - The key to look up.

Returns: 'TValue

Get value at key, with nicer error messages. Throws a KeyNotFoundException if the key is not found.

Extended Type: IDictionary

k : 'TKey

The key to look up.

Returns: 'TValue

this.Items

Full Usage: this.Items

Parameters:
    () : unit

Returns: ('TKey * 'TValue) seq

Returns a lazy seq of key and value tuples

Extended Type: IDictionary

() : unit
Returns: ('TKey * 'TValue) seq

this.KeysSeq

Full Usage: this.KeysSeq

Parameters:
    () : unit

Returns: 'TKey seq

Returns a (lazy) sequence of Keys

Extended Type: IDictionary

() : unit
Returns: 'TKey seq

this.Pop

Full Usage: this.Pop

Parameters:
    k : 'TKey - The key to remove.

Returns: 'TValue The value that was stored at the key.

Get a value and remove it from Dictionary, like *.pop() in Python. Throws a KeyNotFoundException if the key is not found.

Extended Type: IDictionary

k : 'TKey

The key to remove.

Returns: 'TValue

The value that was stored at the key.

this.SetValue

Full Usage: this.SetValue

Parameters:
    k : 'TKey - The key to set.
    v : 'TValue - The value to set.

Set value at key, adds the key if it is missing. With a nicer error message for null keys. Same as Dict.set key value dic

Extended Type: IDictionary

k : 'TKey

The key to set.

v : 'TValue

The value to set.

this.ToString

Full Usage: this.ToString

Parameters:
    entriesToPrint : int - The maximum number of entries to show. Zero or less shows only the header.

Returns: string

A string representation of the IDictionary including the count of entries, the specified amount of entries and the last entry.

Extended Type: IDictionary

entriesToPrint : int

The maximum number of entries to show. Zero or less shows only the header.

Returns: string

this.TryPop

Full Usage: this.TryPop

Parameters:
    k : 'TKey - The key to remove.

Returns: 'TValue option Some value if the key was found, None if not.

Try to get a value and remove it from Dictionary, like *.pop() in Python.

Extended Type: IDictionary

k : 'TKey

The key to remove.

Returns: 'TValue option

Some value if the key was found, None if not.

this.ValuesSeq

Full Usage: this.ValuesSeq

Parameters:
    () : unit

Returns: 'TValue seq

Returns a (lazy) sequence of values

Extended Type: IDictionary

() : unit
Returns: 'TValue seq

Type something to start searching.