Yaaf.FSharp.Helper


Map

Defined in Yaaf.FSharp.Helper.dll.

Extensions for F#'s Map module.

Functions and values

Function or valueDescription
choose f map
Signature: f:('T -> 'b -> 'c option) -> map:Map<'T,'b> -> Map<'T,'c>
Type parameters: 'T, 'b, 'c
findOrDefault key defaultValue map
Signature: key:'T -> defaultValue:'b -> map:Map<'T,'b> -> 'b
Type parameters: 'T, 'b
insertWith f key value map
Signature: f:('?23302 -> '?23302 -> '?23302) -> key:'?23303 -> value:'?23302 -> map:Map<'?23303,'?23302> -> Map<'?23303,'?23302>
Type parameters: '?23302, '?23303

will insert the pair into if does not exist in the map. If the key does exist, the function will insert .

keys map
Signature: map:Map<'T,'b> -> seq<'T>
Type parameters: 'T, 'b

Retrieves the keys from a Map

removeMany keys map
Signature: keys:seq<'T> -> map:Map<'T,'b> -> Map<'T,'b>
Type parameters: 'T, 'b

Allows to remove many keys from a Map

spanWithKey pred map
Signature: pred:('?23296 -> bool) -> map:Map<'?23296,'?23297> -> Map<'?23296,'?23297> * Map<'?23296,'?23297>
Type parameters: '?23296, '?23297
splitWithKey pred d
Signature: pred:('?23299 -> bool) -> d:Map<'?23299,'?23300> -> Map<'?23299,'?23300> * Map<'?23299,'?23300>
Type parameters: '?23299, '?23300
union loses wins
Signature: loses:Map<'a,'b> -> wins:Map<'a,'b> -> Map<'a,'b>
Type parameters: 'a, 'b

Combines the two Maps into a single Map

updateWith f key map
Signature: f:('?23305 -> '?23305 option) -> key:'?23306 -> map:Map<'?23306,'?23305> -> Map<'?23306,'?23305>
Type parameters: '?23305, '?23306

updates the value at key (if it is in the map). If is , the element is deleted. If it is , the key is bound to the new value .

valueList map
Signature: map:Map<'?23308,'?23309> -> '?23309 list
Type parameters: '?23308, '?23309
values map
Signature: map:Map<'T,'b> -> seq<'b>
Type parameters: 'T, 'b

Retrieves the values from a Map

Fork me on GitHub