Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

hyperphor.multitool.core

Various generally useful utilities

Various generally useful utilities
raw docstring

*side-walk-context*clj/s

source

<*clj/s

source

<=*clj/s

source

=*clj/s

source

>*clj/s

source

>=*clj/s

source

add-inverseclj/s

(add-inverse db children-att parent-att)

Given a db (map of maps), and a multi-valued attribute children-att, compute the single-valued inverse relationship as parent-att

Given a db (map of maps), and a multi-valued attribute children-att, compute the single-valued inverse relationship as parent-att
sourceraw docstring

add-inverse-multipleclj/s

(add-inverse-multiple db children-att parent-att)

Given a db (map of maps), and a multi-valued attribute children-att, compute the single-valued inverse relationship as parent-att

Given a db (map of maps), and a multi-valued attribute children-att, compute the single-valued inverse relationship as parent-att
sourceraw docstring

all-keysclj/s

(all-keys sheet-data)

Given a seq of maps, return the union of all keys

Given a seq of maps, return the union of all keys
sourceraw docstring

bag=clj/s

(bag= c1 c2)

True if collections c1 and c2 are equal considered as bags

True if collections c1 and c2 are equal considered as bags
sourceraw docstring

bstrclj/s

(bstr thing)

Name or str of thing. Name means 'better str', better in some contexts anyway,

Name or str of thing. Name means 'better str', better in some contexts anyway,
sourceraw docstring

clean-mapclj/s

(clean-map map)
(clean-map map pred)

Remove values from 'map' based on applying 'pred' to value (default is nullish?).

Remove values from 'map' based on applying 'pred' to value (default is `nullish?`). 
sourceraw docstring

clean-mapsclj/s

(clean-maps map)
(clean-maps pred map)

Remove values recursively from 'map' based on applying 'pred' to value (default is nullish?).

Remove values recursively from 'map' based on applying 'pred' to value (default is `nullish?`). 
sourceraw docstring

clean-seqclj/s

(clean-seq s)

Remove all nullish values from a seq

Remove all nullish values from a seq
sourceraw docstring

clean-walkclj/s

(clean-walk struct)
(clean-walk struct pred)

Remove values from all maps in 'struct' based on 'pred' (default is nullish?).

Remove values from all maps in 'struct' based on 'pred' (default is `nullish?`). 
sourceraw docstring

coerce-booleanclj/s

(coerce-boolean v)

Coerce a value (eg a string from a web API) into a boolean

Coerce a value (eg a string from a web API) into a boolean
sourceraw docstring

coerce-numericclj/s

(coerce-numeric thing)

Attempt to turn thing into a number (long or double). Return number if succesful, otherwise original string

Attempt to turn thing into a number (long or double).
Return number if succesful, otherwise original string
sourceraw docstring

coerce-numeric-hardclj/s

(coerce-numeric-hard thing)

Coerce thing to a number if possible, otherwise return nil

Coerce thing to a number if possible, otherwise return nil
sourceraw docstring

collectingclj/s

(collecting exec)

Exec is a fn of one argument, which is called and passed another fn it can use to collect values; the collection is returned. See tests for example

Exec is a fn of one argument, which is called and passed another fn it can use to collect values; the collection is returned. See tests for example
sourceraw docstring

collecting-mergeclj/s

Exec is a fn of one argument, which is called and passed another fn it can use to collect values which are merged with merge-recursive; the result is returned. See tests for example TODO

Exec is a fn of one argument, which is called and passed another fn it can use to collect values which are merged with merge-recursive; the result is returned. See tests for example TODO
sourceraw docstring

collecting-setclj/s

(collecting-set exec)

Exec is a fn of one argument, which is called and passed another fn it can use to collect values; the collected set returned. See tests for example

Exec is a fn of one argument, which is called and passed another fn it can use to collect values; the collected set returned. See tests for example
sourceraw docstring

comma-listclj/s

(comma-list list)

Splice the non-nullish elements of list together in a string, separated by ', '

Splice the non-nullish elements of list together in a string, separated by ', '
sourceraw docstring

concatvclj/s

(concatv & args)

Concatenate vectors

Concatenate vectors
sourceraw docstring

contains-chars?clj/s

(contains-chars? bads s)
source

de-nsclj/s

(de-ns struct)

De-namespace. Remove the namespaces that backquote insists on adding. See tests for illustration.

De-namespace. Remove the namespaces that backquote insists on adding. See tests for illustration.
sourceraw docstring

def-lazyclj/smacro

(def-lazy var & body)

Like def but produces a delay; value is acceessed via @ and won't be computed until needed

Like `def` but produces a delay; value is acceessed via @ and won't be computed until needed
sourceraw docstring

defaultclj/s

(default map key val)
source

default-param-regexclj/s

source

defaultedclj/s

source

defn-memoizedclj/smacro

(defn-memoized name args & body)

Like defn, but produces a memoized function

Like `defn`, but produces a memoized function
sourceraw docstring

dehumanizeclj/s

(dehumanize map)

Convert string keys to keywords, recursively

Convert string keys to keywords, recursively
sourceraw docstring

delete-keysclj/s

(delete-keys map key-seq)
source

delete-subseqclj/s

(delete-subseq seq subseq)
source

dissoc-ifclj/s

(dissoc-if f hashmap)
source

dissoc-inclj/s

(dissoc-in map [k & k-rest])

Dissoc in a nested map structure

Dissoc in a nested map structure
sourceraw docstring

dissoc-walkclj/s

(dissoc-walk struct & keys)
source

distinct*?clj/s

(distinct*? seq)

Given a seq, return true if all elements are distinct. See distinct?

Given a seq, return true if all elements are distinct. See distinct?
sourceraw docstring

distinct-byclj/s

(distinct-by keyfn coll)

Like distinct, but equality determined by keyfn

Like distinct, but equality determined by keyfn
sourceraw docstring

divide-map-by-valueclj/s

(divide-map-by-value f map)

split map by whether (f v) is true or false

split map by whether (f v) is true or false
sourceraw docstring

divide-withclj/s

(divide-with p coll)
source

doall-safeclj/s

(doall-safe thing)

Realize lazy sequences, if arg is such, otherwise acts as identity

Realize lazy sequences, if arg is such, otherwise acts as identity
sourceraw docstring

doseq*clj/smacro

(doseq* bindings & body)

Like doseq, but goes down lists in parallel rather than nested. Assumes lists are same size.

Like doseq, but goes down lists in parallel rather than nested. Assumes lists are same size.
sourceraw docstring

duplicatesclj/s

(duplicates seq)

Return elements that occur more than once.

Return elements that occur more than once.
sourceraw docstring

error-handling-fnclj/s

(error-handling-fn f)

Returns a fn that acts like f, but return value is [true result] or [false exception] in the case of an error

Returns a fn that acts like f, but return value is [true result] or [false exception] in the case of an error
sourceraw docstring

every-nthclj/s

(every-nth n coll)
source

expand-templateclj/s

(expand-template template
                 bindings
                 &
                 {:keys [param-regex key-fn allow-missing?]
                  :or {param-regex default-param-regex key-fn treeword}})

Template is a string containing {{foo}} elements, which get replaced by corresponding values from bindings. See tests for examples. {{foo.bar}} works for nested maps

Template is a string containing {{foo}} elements, which get replaced by corresponding values from bindings. See tests for examples.  {{foo.bar}} works for nested maps
sourceraw docstring

expand-template-recurclj/s

(expand-template-recur tmplate & args)

Like expand-template but will recurse, so the template replacements can contain parameters

Like expand-template but will recurse, so the template replacements can contain parameters
sourceraw docstring

expand-template-stringclj/s

source

extend-seqclj/s

(extend-seq seq)

Return a seq padded out to infinity with nils

Return a seq padded out to infinity with nils
sourceraw docstring

filter-restclj/s

(filter-rest f seq)

A lazy sequence generated by applying f to seq and its tails

A lazy sequence generated by applying f to seq and its tails
sourceraw docstring

fixclj/s

(fix f)

Fixed-point combinator, useful in conjunction with memoization

Fixed-point combinator, useful in conjunction with memoization
sourceraw docstring

following-eltclj/s

(following-elt elt seq)
source

for*clj/smacro

(for* bindings & body)

Like for but goes down lists in parallel rather than nested. Assumes lists are same size.

Like for but goes down lists in parallel rather than nested. Assumes lists are same size.
sourceraw docstring

forcatclj/smacro

(forcat vars body)
source

forfclj/smacro

(forf forms body)

Like for but filters out nullish? values

Like for but filters out nullish? values
sourceraw docstring

freq-mapclj/s

(freq-map seq)
source

fsblclj/s

(fsbl o f & args)

The first (arg) shall be last (for use in -> chains)

The first (arg) shall be last (for use in -> chains)
sourceraw docstring

get-in*clj/s

(get-in* m ks)

Like core/get-in but a key (selector) can be a predicate fn which will pick an element from a sequence.

Like core/get-in but a key (selector) can be a predicate fn which will pick an element from a sequence.
sourceraw docstring

glob->regexclj/s

(glob->regex s)

Takes a glob-format string and returns an equivalent regex.

Takes a glob-format string and returns an equivalent regex.
sourceraw docstring

group-by-and-transformclj/s

(group-by-and-transform by f seq)

Like group-by, but the values of the resultant map have f mapped over them

Like group-by, but the values of the resultant map have f mapped over them
sourceraw docstring

group-by-dupsclj/s

(group-by-dups f seq)

Like group-by but return only groups with >1 member

Like group-by but return only groups with >1 member
sourceraw docstring

group-by-multipleclj/s

(group-by-multiple f coll)

Like group-by, but f produces a seq of values rather than a single one; the orginal value gets grouped with each of them

Like group-by, but f produces a seq of values rather than a single one; the orginal value gets grouped with each of them
sourceraw docstring

hex-stringclj/s

(hex-string n)

Output number as hex string

Output number as hex string
sourceraw docstring

ignore-errorsclj/smacro

(ignore-errors & body)

Execute body; if an exception occurs ignore it and return nil. Note: strongly deprecated for production code.

Execute `body`; if an exception occurs ignore it and return `nil`. Note: strongly deprecated for production code.
sourceraw docstring

ignore-reportclj/smacro

(ignore-report & body)

Execute body, if an exception occurs, print a message and continue

Execute `body`, if an exception occurs, print a message and continue
sourceraw docstring

ignore-returnclj/smacro

(ignore-return & body)

Execute body, if an exception occurs, return it

Execute `body`, if an exception occurs, return it
sourceraw docstring

index-byclj/s

(index-by f coll)

Return a map of the elements of coll indexed by (f elt). Similar to group-by, but overwrites elts with same index rather than producing vectors.

Return a map of the elements of coll indexed by (f elt). Similar to group-by, but overwrites elts with same index rather than producing vectors. 
sourceraw docstring

index-by-and-transformclj/s

(index-by-and-transform f g coll)

Return a map of the elements of coll indexed by (f elt) and transformed by (g elt).

Return a map of the elements of coll indexed by (f elt) and transformed by (g elt). 
sourceraw docstring

index-by-multipleclj/s

(index-by-multiple f coll)

Like index-by, but f produces a seq of values rather than a single one

Like index-by, but f produces a seq of values rather than a single one
sourceraw docstring

index-by-orderedclj/s

(index-by-ordered f coll)

Return an array map of the elements of coll indexed by (f elt), preserving the order. See index-by

Return an array map of the elements of coll indexed by (f elt), preserving the order. See index-by
sourceraw docstring

index-by-safelyclj/s

(index-by-safely f coll)

Return a map of the elements of coll indexed by (f elt). Throw an exception of there are duplicate keys.

Return a map of the elements of coll indexed by (f elt). Throw an exception of there are duplicate keys.
sourceraw docstring

insert-afterclj/s

(insert-after seq elt after)

Insert elt after after in seq. Throw exception if elt is not present.

Insert `elt` after `after` in `seq`. Throw exception if elt is not present.
sourceraw docstring

insert-beforeclj/s

(insert-before seq elt before)

Insert elt before before in seq. Throw exception if elt is not present.

Insert `elt` before `before` in `seq`. Throw exception if elt is not present.
sourceraw docstring

intercalateclj/s

(intercalate l1 l2)

Given 2 seqs, produce a seq with alternating elements.

Given 2 seqs, produce a seq with alternating elements.
sourceraw docstring

into-stringclj/s

(into-string thing)

Convert a set or seq of chars into a string. Like (into "" <str>) if that worked.

Convert a set or seq of chars into a string. Like (into "" <str>) if that worked.
sourceraw docstring

iterate-untilclj/s

(iterate-until f start)
(iterate-until pred f start)

Iterate f on start until a value is produced that passes pred, returns value.

Iterate f on start until a value is produced that passes pred, returns value.
sourceraw docstring

join-seqclj/s

(join-seq sep seq)

Like str/join but makes a list, useful for HTML generation

Like str/join but makes a list, useful for HTML generation
sourceraw docstring

key-counterclj/s

source

keyword-concclj/s

(keyword-conc & parts)

Concatenate parts (which are keywords, strings, anything acceptable to name) into a keyword

Concatenate parts (which are keywords, strings, anything acceptable to name) into a keyword
sourceraw docstring

keyword-safeclj/s

(keyword-safe str)

Make a string into a readable keyword by replacing certain punctuation

Make a string into a readable keyword by replacing certain punctuation
sourceraw docstring

keywordizeclj/s

(keywordize map & keys)

Convert the values of selected keys to keywords

Convert the values of selected keys to keywords
sourceraw docstring

keywordize-keysclj/s

(keywordize-keys map)
source

labelizeclj/s

(labelize s)

Convert - and _ to spaces

Convert - and _ to spaces
sourceraw docstring

lconjclj/s

(lconj v e)

Conj a value to the front (left) of vector. Not performant

Conj a value to the front (left) of vector. Not performant
sourceraw docstring

ldifferenceclj/s

(ldifference list1 list2)

Compute the set difference of list1 - `list2'

Compute the set difference of `list1` - `list2'
sourceraw docstring

lintersectionclj/s

(lintersection & lists)

Compute the intersection of lists

Compute the intersection of `lists`
sourceraw docstring

lsbfclj/s

(lsbf f & args)

The last (arg) shall be first (for use in ->> chains)

The last (arg) shall be first (for use in ->> chains)
sourceraw docstring

lunionclj/s

(lunion & lists)

Compute the union of lists

Compute the union of `lists`
sourceraw docstring

make-collecterclj/s

(make-collecter init collect-fn)
source

map-bidirectionalclj/s

(map-bidirectional map)
source

map-chunkedclj/s

(map-chunked f chunk-size l)

Call f with chunk-sized subsequences of l, concat the results

Call f with chunk-sized subsequences of l, concat the results
sourceraw docstring

map-diffclj/s

(map-diff a b)

Returns a recursive diff of two maps, which you will want to prettyprint.

Returns a recursive diff of two maps, which you will want to prettyprint.
sourceraw docstring

map-entryclj

(map-entry [k v])
(map-entry k v)

Make a map entry

Make a map entry
sourceraw docstring

map-invert-multipleclj/s

(map-invert-multiple m)

Returns the inverse of map with the vals mapped to the keys. Like set/map-invert, but does the sensible thing with multiple values. Ex: (map-invert-multiple {:a 1, :b 2, :c [3 4], :d 3}) ==>⇒ {2 #{:b}, 4 #{:c}, 3 #{:c :d}, 1 #{:a}}

Returns the inverse of map with the vals mapped to the keys. Like set/map-invert, but does the sensible thing with multiple values.
Ex: `(map-invert-multiple  {:a 1, :b 2, :c [3 4], :d 3}) ==>⇒ {2 #{:b}, 4 #{:c}, 3 #{:c :d}, 1 #{:a}}`
sourceraw docstring

map-key-valuesclj/s

(map-key-values f hashmap)

Map f over [k v] of hashmap, returning new v

Map f over [k v] of hashmap, returning new v
sourceraw docstring

map-keysclj/s

(map-keys f hashmap)

Map f over the keys of hashmap

Map f over the keys of hashmap
sourceraw docstring

map-keys-recursiveclj/s

(map-keys-recursive f hashmap)

Map f over the keys of hashmap, and any nested hashmaps

Map f over the keys of hashmap, and any nested hashmaps
sourceraw docstring

map-terminalsclj/s

(map-terminals f hashmap)

Map f over all terminal elements of hashmap

Map f over all terminal elements of hashmap
sourceraw docstring

map-valuesclj/s

(map-values f hashmap)

Map f over the values of hashmap

Map f over the values of hashmap
sourceraw docstring

mapcatfclj/s

(mapcatf f & args)

Like mapcat but filters out nullish? values

Like mapcat but filters out nullish? values
sourceraw docstring

mapfclj/s

(mapf f & args)

Like map but filters out nullish? values. Close to clojure.core/keep but uses different test.

Like map but filters out nullish? values. Close to clojure.core/keep but uses different test.
sourceraw docstring

mapxclj/s

(mapx f seq)
source

max*clj/s

source

max-byclj/s

(max-by keyfn seq)

Find the maximum element of seq based on keyfn

Find the maximum element of `seq` based on keyfn
sourceraw docstring

memoize-cacheclj/s

(memoize-cache name)

Return the cache (map of args to values) for a named memoizer.

Return the cache (map of args to values) for a named memoizer.
sourceraw docstring

memoize-namedclj/s

(memoize-named name f)

Like clojure.core/memoize, but retains a ptr to the cache so it can be cleared (see memoize-reset)

Like clojure.core/memoize, but retains a ptr to the cache so it can be cleared (see memoize-reset)
sourceraw docstring

memoize-recclj/smacro

(memoize-rec form)
source

memoize-reset!clj/s

(memoize-reset!)
(memoize-reset! name)

Clear the cache of one or all memoized fns

Clear the cache of one or all memoized fns
sourceraw docstring

memoizer-statsclj/s

(memoizer-stats)

Return information about all memoize-name fns

Return information about all memoize-name fns
sourceraw docstring

memoizersclj/s

source

merge-inclj/s

(merge-in map [k & k-rest] changes)

Merge in a nested map structure

Merge in a nested map structure
sourceraw docstring

merge-recursiveclj/s

(merge-recursive m1 m2)

Recursively merge two arbitrariy nested map structures. Terminal seqs are concatentated, terminal sets are merged.

Recursively merge two arbitrariy nested map structures. Terminal seqs are concatentated, terminal sets are merged.
sourceraw docstring

merge-recursive-withclj/s

(merge-recursive-with f m1 m2)

Recursively merge two arbitrariy nested map structures, merging terminals (non-maps) with f

Recursively merge two arbitrariy nested map structures, merging terminals (non-maps) with f
sourceraw docstring

middle-eltclj/s

(middle-elt seq)
source

min*clj/s

source

min-byclj/s

(min-by keyfn seq)

Find the minimum element of seq based on keyfn

Find the minimum element of `seq` based on keyfn
sourceraw docstring

n-charsclj

source

negateclj/s

(negate f)
source

neighborhoodclj/s

(neighborhood from n neighbors)

Computes the neighborhood of radius n from from, neighbors is a function that produces the immediate neighbors

Computes the neighborhood of radius n from from, neighbors is a function that produces the immediate neighbors
sourceraw docstring

nullifyclj/s

(nullify v)

Convert nullish values to nil

Convert nullish values to nil
sourceraw docstring

nullish?clj/s

(nullish? v)

True if value is something we probably don't care about (nil, false, empty seqs, empty strings)

True if value is something we probably don't care about (nil, false, empty seqs, empty strings)
sourceraw docstring

numeric-prefix-sort-keyclj/s

(numeric-prefix-sort-key s)

Provide a key for sorting strings with leading numbers

Provide a key for sorting strings with leading numbers
sourceraw docstring

oneofclj/s

(oneof & things)

true if exactly one of its arguments is non-nil.

true if exactly one of its arguments is non-nil.
sourceraw docstring

or-nilclj/s

(or-nil pred)

Given a 1-arg pred, return a new fn that acts as identity if pred is true, nil otherwise

Given a 1-arg pred, return a new fn that acts as identity if pred is true, nil otherwise
sourceraw docstring

or-nullishclj/smacro

(or-nullish)
(or-nullish x)
(or-nullish x & next)

Like or but will return the first non-nullish value

Like or but will return the first non-nullish value
sourceraw docstring

ordinalclj/s

(ordinal n)

Ordinal string for number n, eg 123 → "123rd"

Ordinal string for number n, eg 123 → "123rd"
sourceraw docstring

ordinal-suffixclj/s

(ordinal-suffix n)

The suffix for the ordinal version of n

The suffix for the ordinal version of n
sourceraw docstring

param-regex-double-bracesclj/s

source

param-regex-javascriptclj/s

source

parse-comma-listclj/s

(parse-comma-list s)

Parse a comma-separated string into parts

Parse a comma-separated string into parts 
sourceraw docstring

partition-diffclj/s

(partition-diff f coll)

Partition coll between v1 and v2 at points for which (f v1 v2) is true

Partition coll between v1 and v2 at points for which (f v1 v2) is true
sourceraw docstring

partition-ifclj/s

(partition-if f coll)

Partition coll at every v for which (f v) is true

Partition coll at every v for which (f v) is true
sourceraw docstring

pattern-matchclj/s

(pattern-match pat thing)

Ultra-simple structure pattern matcher. Variables are (? <name>), bindings

Ultra-simple structure pattern matcher. Variables are (? <name>), bindings 
sourceraw docstring

positionclj/s

(position pred coll)

Returns the first index of coll for which pred is true

Returns the first index of coll for which pred is true
sourceraw docstring

position=clj/s

(position= elt coll & [key-fn])

Returns the first index of coll that equals elt

Returns the first index of coll that equals elt
sourceraw docstring

positionsclj/s

(positions pred coll)

Returns a list of indexes of coll for which pred is true

Returns a list of indexes of coll for which pred is true
sourceraw docstring

positions=clj/s

(positions= elt coll & [key-fn])

Return list of indexes of coll that equals elt

Return list of indexes of coll that equals elt
sourceraw docstring

powersetclj/s

(powerset s)

Compute the powerset P(s) of a set

Compute the powerset P(s) of a set
sourceraw docstring

preceding-eltclj/s

(preceding-elt elt seq)
source

present?clj/s

(present? v)
source

punc-charsclj/s

source

rand-aroundclj/s

(rand-around p range)

Return a random float within range of p

Return a random float within range of p
sourceraw docstring

rand-rangeclj/s

(rand-range a b)

Return a random float between a and b

Return a random float between a and b
sourceraw docstring

rand-range-intclj/s

(rand-range-int a b)

Return a random int between a and b

Return a random int between a and b
sourceraw docstring

random-elementclj/s

(random-element seq)

Return a random element from a seq

Return a random element from a seq
sourceraw docstring

random-elementsclj/s

(random-elements n seq)

Return n random elements from a seq

Return n random elements from a seq
sourceraw docstring

range-truncateclj/s

(range-truncate v lower upper)

Return the closest value to v within range [lower, upper]

Return the closest value to v within range [lower, upper]
sourceraw docstring

re-pattern-literalclj/s

(re-pattern-literal string)

Return a regex that will match the literal string

Return a regex that will match the literal string
sourceraw docstring

re-pattern-literal-nocaseclj/s

(re-pattern-literal-nocase string)

Return a regex that will match the literal string, case insensitive

Return a regex that will match the literal string, case insensitive
sourceraw docstring

re-quoteclj/s

(re-quote s)
source

re-seq-positionsclj

(re-seq-positions re s & [group])

Returns a lazy sequence of successive matches of pattern in string, returning [start end] pairs

Returns a lazy sequence of successive matches of pattern in string, returning [start end] pairs
sourceraw docstring

re-substituteclj

(re-substitute re s)
(re-substitute re s subfn)

Match re against s, apply subfn to matching substrings. Return list of fragments, processed and otherwise

Match re against s, apply subfn to matching substrings. Return list of fragments, processed and otherwise
sourceraw docstring

real-vector?clj/s

(real-vector? thing)

True iff thing is a real vector. Shouldn't be necessary, but (vector? (first {:a 1})) ⇒ true. Most useful for walker fns.

True iff thing is a real vector. Shouldn't be necessary, but (vector? (first {:a 1})) ⇒ true. Most useful for walker fns.
sourceraw docstring

redactclj/s

(redact m)
source

redact-keyclj/s

(redact-key m k)

Takes a map and a key. Walks the map, if the key is anywhere in there, and has a value, redacts it. Used for hiding passwords in log files.

Takes a map and a key.
Walks the map, if the key is anywhere in there, and has a value, redacts it.
Used for hiding passwords in log files.
sourceraw docstring

redact-keysclj/s

(redact-keys m ks)

Takes a map and a coll of keys. Walks the map, if the key is anywhere in there, and has a value, redacts it. Used for hiding passwords in log files.

Takes a map and a coll of keys.
Walks the map, if the key is anywhere in there, and has a value, redacts it.
Used for hiding passwords in log files.
sourceraw docstring

redactableclj/s

source

remove-nil-valuesclj/s

(remove-nil-values hashmap)
source

remove=clj/s

(remove= elt seq & [key-fn])

Remove occurences of elt in seq, applying key-fn before testing if supplied

Remove occurences of elt in seq, applying key-fn before testing if supplied
sourceraw docstring

rename-keyclj/s

(rename-key map from to)
source

rest-whileclj/s

(rest-while pred coll)

Like take-while but applies pred to successive tails of the seq, and returns a seq of tails

Like take-while but applies pred to successive tails of the seq, and returns a seq of tails
sourceraw docstring

roundclj/s

(round n)

Round the argument

Round the argument
sourceraw docstring

safe-incclj/s

source

safe-nameclj/s

(safe-name thing)
source

safe-nthclj/s

(safe-nth col n)

Like nth but will return nil if out of bounds rather than erroring

Like nth but will return nil if out of bounds rather than erroring
sourceraw docstring

safelyclj/s

(safely f)
(safely f default)

Given f, produce new function that permits nulling.

Given f, produce new function that permits nulling.
sourceraw docstring

saferlyclj/s

(saferly f)
(saferly f default)

Given f, produce new function that will return nils if exception is thrown. Not recommended for production code

Given f, produce new function that will return nils if exception is thrown. Not recommended for production code
sourceraw docstring

safestlyclj/s

(safestly f)

Given f, produce new function that will return original if exception is thrown. Not recommended for production code

Given f, produce new function that will return original if exception is thrown. Not recommended for production code
sourceraw docstring

samples-byclj/s

(samples-by f map n)
source

sconjclj/s

(sconj coll elt)

Like conj but will always create a set.

Like conj but will always create a set.
sourceraw docstring

select-byclj/s

(select-by seq prop val)
source

self-labelclj/s

(self-label attr hashmap)

Given a map HASHMAP with maps as values, adds the index to each value as the value of attriute ATTR

Given a map HASHMAP with maps as values, adds the index to each value as the value of attriute ATTR
sourceraw docstring

separateclj/s

(separate pred coll)

Separate coll into two collections based on pred.

Separate coll into two collections based on pred.
sourceraw docstring

sequencifyclj/s

(sequencify thing)

Turn thing into a sequence if it already isn't one

Turn thing into a sequence if it already isn't one
sourceraw docstring

set-toggleclj/s

(set-toggle aset elt)

Toggle presence of elt in set (set can be nil)

Toggle presence of elt in set (set can be nil)
sourceraw docstring

set=clj/s

(set= c1 c2)

True if collections c1 and c2 are equal considered as sets

True if collections c1 and c2 are equal considered as sets
sourceraw docstring

side-walkclj/s

(side-walk f form)

Walks form, an arbitrary data structure, evaluating f on each element for side effects. Note: has nothing to do with the standard (functional) walker, and maybe should have a different name (traverse?)

Walks form, an arbitrary data structure, evaluating f on each element for side effects. Note: has nothing to do with the standard (functional) walker, and maybe should have a different name (traverse?)
sourceraw docstring

side-walk-find-pathsclj/s

(side-walk-find-paths pred form)
source

side-walk-pathsclj/s

(side-walk-paths f form)
(side-walk-paths f form path)
source

some-thingclj/s

(some-thing pred seq)

Like some, but returns the original value of the seq rather than the result of the predicate.

Like some, but returns the original value of the seq rather than the result of the predicate.
sourceraw docstring

sort-map-by-valuesclj/s

(sort-map-by-values m)
source

sort-map-by-values-fnclj/s

(sort-map-by-values-fn f m)
source

sort-with-numeric-prefixclj/s

(sort-with-numeric-prefix seq)

Sort a seq of strings, treating leading numbers in a sane way

Sort a seq of strings, treating leading numbers in a sane way
sourceraw docstring

str-replace-multipleclj/s

(str-replace-multiple map string)
source

stratifyclj/s

(stratify g predecessors depth-prop)

g is a map, predecessors is a function of g values to g indices. computes for each node the depth: if no predecssors 0, otherwise (inc (max (depth predecssors))) useful for laying out DAGs, possibly elsewhere

g is a map, predecessors is a function of g values to g indices.
computes for each node the depth: if no predecssors 0, otherwise (inc (max (depth predecssors)))
useful for laying out DAGs, possibly elsewhere
sourceraw docstring

string-includes-uncased?clj/s

(string-includes-uncased? s substr)

Case insensitive version of str/includes?

Case insensitive version of str/includes?
sourceraw docstring

strip-charsclj/s

(strip-chars removed s)

Removes every character of a given set from a string

Removes every character of a given set from a string
sourceraw docstring

subseqsclj/s

(subseqs seq i)

Returns a seq of all i-length subseqs

Returns a seq of all i-length subseqs
sourceraw docstring

substituteclj/s

(substitute struct vmap)

vmap defines a substitution; Walk struct, replacing any keys that appear in vmap with corresponding value.

vmap defines a substitution; Walk `struct`, replacing any keys that appear in vmap with corresponding value.
sourceraw docstring

substitute-genclj/s

(substitute-gen struct vmap generator)

Like substitute, but for any terminal elements not in map, call generator on first occurance to generate a value.

Like `substitute`, but for any terminal elements not in map, call `generator` on first occurance to generate a value.
sourceraw docstring

throwable?clj/s

(throwable? x)
source

transitive-closureclj/s

(transitive-closure f)

f is a fn of one arg that returns a list. Returns a new fn that computes the transitive closure of f.

f is a fn of one arg that returns a list. Returns a new fn that computes the transitive closure of f.
sourceraw docstring

transposeclj/s

(transpose matrix)
source

treewordclj/s

(treeword s)

Like keyword but supports foo.bar syntax, will generate the appropriate accessor

Like keyword but supports foo.bar syntax, will generate the appropriate accessor
sourceraw docstring

trim-charsclj/s

(trim-chars removed s)

Removes every character of a given set from the ends of a string

Removes every character of a given set from the ends of a string
sourceraw docstring

trim-chars-leftclj/s

(trim-chars-left removed s)

Removes every character of a given set from the left end of a string

Removes every character of a given set from the left end of a string
sourceraw docstring

trim-chars-rightclj/s

(trim-chars-right removed s)

Removes every character of a given set from the right end of a string

Removes every character of a given set from the right end of a string
sourceraw docstring

trueish?clj/s

(trueish? x)
source

truncate-stringclj/s

(truncate-string s n)
source

truthy?clj/s

(truthy? x)

Return false if x is nil or false, true otherwise

Return false if x is nil or false, true otherwise
sourceraw docstring

txclj/smacro

(tx template)

Expand a template based on lexically defined variables

Expand a template based on lexically defined variables
sourceraw docstring

uncollideclj/s≠

clj
(uncollide seq
           &
           {:keys [key-fn new-key-fn existing]
            :or {key-fn identity
                 new-key-fn (fn* [p1__2104#] (str p1__2104# "-1"))
                 existing #{}}})
cljs
(uncollide seq
           &
           {:keys [key-fn new-key-fn existing]
            :or {key-fn identity
                 new-key-fn (fn* [p1__4225#] (str p1__4225# "-1"))
                 existing #{}}})

Given a seq, return a new seq where the elements are guaranteed unique (relative to key-fn), using new-key-fn to generate new elements

Given a seq, return a new seq where the elements are guaranteed unique (relative to key-fn), using new-key-fn to generate new elements
sourceraw docstring

underscore->camelcaseclj/s

(underscore->camelcase s)

Convert foo_bar into fooBar

Convert foo_bar into fooBar
sourceraw docstring

union-byclj/s

(union-by f s1 s2)

Return unique elements in (union s1 s2) given f as identity key

Return unique elements in (union s1 s2) given f as identity key
sourceraw docstring

unique-keyclj/s

(unique-key root)

Produce a unique keyword based on root.

Produce a unique keyword based on root.
sourceraw docstring

unique-relative-toclj/s

(unique-relative-to s existing suffix)

Generate a name based on s, that is not already found in existing.

Generate a name based on s, that is not already found in existing.
sourceraw docstring

unlistclj/s

(unlist thing)
source

unmapclj/s

(unmap m key-key)
source

update!clj/s

(update! map k f & args)
source

update-some-keysclj/s

(update-some-keys map f & keys)
source

validate-templateclj/s

(validate-template template
                   fields
                   &
                   {:keys [param-regex] :or {param-regex default-param-regex}})

Validate a template, defined as in expand-template-string; fields is a set of allowed field names

Validate a template, defined as in expand-template-string; fields is a set of allowed field names
sourceraw docstring

vdelete=clj/s

(vdelete= elt v)
source

walk-all-keysclj/s

(walk-all-keys f thing)

Walk all the keywords in thing recursively

Walk all the keywords in thing recursively
sourceraw docstring

walk-collectclj/s

(walk-collect f thing)

Walk f over thing and return a vector of the non-nil returned values

Walk f over thing and return a vector of the non-nil returned values
sourceraw docstring

walk-collect-setclj/s

(walk-collect-set f thing)

Walk f over thing and return a set of the non-nil returned values

Walk f over thing and return a set of the non-nil returned values
sourceraw docstring

walk-filteredclj/s

(walk-filtered f thing filter)

Walk thing, applying f to every object that passes filter

Walk thing, applying f to every object that passes filter
sourceraw docstring

walk-findclj/s

(walk-find f thing)

Walk over thing and return the first val for which f is non-nil

Walk over thing and return the first val for which f is non-nil
sourceraw docstring

walk-find-pathclj/s

(walk-find-path f thing)

Walk over thing and return [<the first val for which f is non-nil>, <path>]

Walk over thing and return [<the first val for which f is non-nil>, <path>]
sourceraw docstring

walk-keysclj/s

(walk-keys f keys thing)

Walk all the map entries in thing matching key (a key or set)

Walk all the map entries in thing matching key (a key or set)
sourceraw docstring

walk-map-entriesclj/s

(walk-map-entries f thing)

Walk all the map entries in thing

Walk all the map entries in thing
sourceraw docstring

walk-reduceclj/s

(walk-reduce f form init)

Walks form with an accumulator. f is a function of [accumulator elt], init is initial val of accumulator.

Walks form with an accumulator. f is a function of [accumulator elt], init is initial val of accumulator.
sourceraw docstring

xorclj/s

(xor a b)

boolean a xor b

boolean a xor b
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close