Namespace: FSharpx.Collections

Extensions for F#'s Map module.

Functions and values

Function or valueDescription
catOptionKeys table
Signature: table:Map<Option<'a>,'b> -> Map<'a,'b>
Type parameters: 'a, 'b

The catOptions function takes a map of Options and values and returns a map of all the Some keys and values.

catOptionValues table
Signature: table:Map<'a,Option<'b>> -> Map<'a,'b>
Type parameters: 'a, 'b

The catOptions function takes a map of keys and Options and returns a map of all the keys and Some values.

choose f map
Signature: f:('T -> 'b -> 'c option) -> map:Map<'T,'b> -> Map<'T,'c>
Type parameters: 'T, 'b, 'c
equalsWith eq xs ys
Signature: eq:('?9306 * '?9307 -> '?9306 * '?9307 -> bool) -> xs:Map<'?9306,'?9307> -> ys:Map<'?9306,'?9307> -> bool
Type parameters: '?9306, '?9307

Compares two maps for equality using the given comparison function, element by element.

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:('?9269 -> '?9269 -> '?9269) -> key:'?9270 -> value:'?9269 -> map:Map<'?9270,'?9269> -> Map<'?9270,'?9269>
Type parameters: '?9269, '?9270

insertWith f key value mp will insert the pair (key, value) into mp if key does not exist in the map. If the key does exist, the function will insert f newvalue oldvalue.

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

Retrieves the keys from a Map

keySet map
Signature: map:Map<'?9294,'?9295> -> Set<'?9294>
Type parameters: '?9294, '?9295

Retrieves the key set 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:('?9263 -> bool) -> map:Map<'?9263,'?9264> -> Map<'?9263,'?9264> * Map<'?9263,'?9264>
Type parameters: '?9263, '?9264
splitWithKey pred d
Signature: pred:('?9266 -> bool) -> d:Map<'?9266,'?9267> -> Map<'?9266,'?9267> * Map<'?9266,'?9267>
Type parameters: '?9266, '?9267
union loses wins
Signature: loses:Map<'?9278,'?9279> -> wins:Map<'?9278,'?9279> -> Map<'?9278,'?9279>
Type parameters: '?9278, '?9279

Combines the two Maps into a single Map

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

update f k map updates the value x at key k (if it is in the map). If f x is None, the element is deleted. If it is Some y, the key is bound to the new value y.

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

Retrieves the values from a Map

Fork me on GitHub