Liking cljdoc? Tell your friends :D

bifurcan-clj.map

Functions for working with sorted and hash maps.

Functions for working with sorted and hash maps.
raw docstring

ceilclj

(ceil m k)

The entry whose key is either equal to k, or just above it. If k is less than the minimum value in the map, returns nil.

The entry whose key is either equal to k, or just above it. If k is less
than the minimum value in the map, returns nil.
sourceraw docstring

ceil-indexclj

(ceil-index m k)

The index of the entry whose key is either equal to key, or just above it. If key is greater than the maximum value in the map, returns null.

The index of the entry whose key is either equal to key, or just above it.
If key is greater than the maximum value in the map, returns null.
sourceraw docstring

comparatorclj

(comparator m)

Returns the comparator function for two keys.

Returns the comparator function for two keys.
sourceraw docstring

contains-all?clj

(contains-all? m other)

True if this map contains all keys in the given map or set.

True if this map contains all keys in the given map or set.
sourceraw docstring

contains-any?clj

(contains-any? m other)

True if this map contains any keys in the given map or set.

True if this map contains any keys in the given map or set.
sourceraw docstring

contains?clj

(contains? m k)

Does the given map contain a key?

Does the given map contain a key?
sourceraw docstring

differenceclj

(difference m ks)

Takes a map and removes all keys in the given set/map

Takes a map and removes all keys in the given set/map
sourceraw docstring

emptyclj

The empty map.

The empty map.
sourceraw docstring

entriesclj

(entries m)

Returns a list of entries in the map.

Returns a list of entries in the map.
sourceraw docstring

firstclj

(first m)

The first entry of a sorted map

The first entry of a sorted map
sourceraw docstring

floorclj

(floor m k)

The entry whose key is either equal to k, or just below it. If k is less than the minimum value in the map, returns nil.

The entry whose key is either equal to k, or just below it. If k is less
than the minimum value in the map, returns nil.
sourceraw docstring

floor-indexclj

(floor-index m k)

The index of the entry whose key is either equal to key, or just below it. If key is less than the minimum value in the map, returns null.

The index of the entry whose key is either equal to key, or just below it.
If key is less than the minimum value in the map, returns null.
sourceraw docstring

Fromcljprotocol

fromclj

(from x)

Constructs a map from another collection. Can take a Bifurcan map, a Bifurcan list of Bifurcan Entries, or an iterable/reducible/seqable of anything that can be coerced to an Entry--Clojure map entries, [k v] vector pairs, or Bifurcan entries.

Constructs a map from another collection. Can take a Bifurcan map, a
Bifurcan list of Bifurcan Entries, or an iterable/reducible/seqable of
anything that can be coerced to an Entry--Clojure map entries, [k v]
vector pairs, or Bifurcan entries.

sorted-map-fromclj

(sorted-map-from x)

Constructs a sorted map from another collection. Can take a Bifurcan map or an iterable/reducible/seqable of anything that can be coerced to an Entry--Clojure map entries, [k v] vector pairs, or Bifurcan entries.

Constructs a sorted map from another collection. Can take a
Bifurcan map or an iterable/reducible/seqable of anything
that can be coerced to an Entry--Clojure map entries, [k v]
vector pairs, or Bifurcan entries.
source

from-reduceclj

(from-reduce init pairs)

Takes an initial map and a reducible of things that can be coerced to entries. Adds all those entries to the map and returns the map, forked.

Takes an initial map and a reducible of things that can be coerced to
entries. Adds all those entries to the map and returns the map, forked.
sourceraw docstring

getclj

(get m k)
(get m k not-found)

Gets a key from a map. Returns the value, or nil if not found. Can take an explicit not-found value.

Gets a key from a map. Returns the value, or nil if not found. Can take an
explicit not-found value.
sourceraw docstring

get-or-createclj

(get-or-create m k f)

Gets a key, or a value generated by (f) if there is no such key.

Gets a key, or a value generated by (f) if there is no such key.
sourceraw docstring

index-ofclj

(index-of m k)

Returns the long index of a key, if present, or nil.

Returns the long index of a key, if present, or nil.
sourceraw docstring

intersectionclj

(intersection m ks)

Takes a map and retains only the keys in the given set.

Takes a map and retains only the keys in the given set.
sourceraw docstring

keyclj

(key entry)

The key of a map entry.

The key of a map entry.
sourceraw docstring

key-equalityclj

(key-equality m)

The key equality function used by this map.

The key equality function used by this map.
sourceraw docstring

key-hashclj

(key-hash m)

The key hash function used by this map.

The key hash function used by this map.
sourceraw docstring

keysclj

(keys m)

Returns the set of keys in the map.

Returns the set of keys in the map.
sourceraw docstring

lastclj

(last m)

The last entry of a sorted map

The last entry of a sorted map
sourceraw docstring

mapclj

(map)
(map hash-fn equals-fn)

Constructs an empty map. optionally takes a hash and equality function.

Constructs an empty map. optionally takes a hash and equality function.
sourceraw docstring

map-valuesclj

(map-values m f)

Transforms all values using a function (f k v).

Transforms all values using a function (f k v).
sourceraw docstring

mergeclj

(merge a b)
(merge a b merge-fn)

Merges two maps together, optionally using the given merge function.

Merges two maps together, optionally using the given merge function.
sourceraw docstring

putclj

(put m k v)
(put m k v merge)

Sets a key to a value. Optionally takes a function (merge current-val new-val) to combine an existing value.

Sets a key to a value. Optionally takes a function (merge current-val
new-val) to combine an existing value.
sourceraw docstring

removeclj

(remove m k)

Removes a key from the map.

Removes a key from the map.
sourceraw docstring

sliceclj

(slice m min max)

Returns a sorted map with all entries with keys in [min max] inclusive.

Returns a sorted map with all entries with keys in [min max] inclusive.
sourceraw docstring

sorted-mapclj

(sorted-map)
(sorted-map comparator)

Constructs an empty sorted map with the given comparator.

Constructs an empty sorted map with the given comparator.
sourceraw docstring

ToEntrycljprotocol

->entryclj

(->entry pair)

Coerces a pair to an entry.

Coerces a pair to an entry.
source

unionclj

(union m1 m2)

The union of two maps, with values from m2 shadowing m1.

The union of two maps, with values from m2 shadowing m1.
sourceraw docstring

updateclj

(update m k f)
(update m k f a)
(update m k f a b)
(update m k f a b & more)

Updates a key by applying a function to the current value, or nil if it does not exist. With additional arguments a b ..., calls (f current-value a b ...).

Updates a key by applying a function to the current value, or nil if it does
not exist. With additional arguments a b ..., calls (f current-value a b
...).
sourceraw docstring

valueclj

(value entry)

The value of a map entry.

The value of a map entry.
sourceraw docstring

valuesclj

(values m)

Returns the list of values in the map.

Returns the list of values in the map.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close