Skip to main content

Transformation

59
  • butlast

    Return a seq of all but the last item in coll, in linear time

  • cat

    A transducer which concatenates the contents of each input, which must be a collection, into the reduction.

  • concat

    Returns a lazy seq representing the concatenation of the elements in the supplied colls.

  • dedupe

    Returns a lazy sequence removing consecutive duplicates in coll. Returns a transducer when no collection is provided.

  • distinct

    Returns a lazy sequence of the elements of coll with duplicates removed. Returns a stateful transducer when no collectio...

  • doall

    When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce th...

  • dorun

    When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce th...

  • doseq

    Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retai...

  • drop

    Returns a laziness-preserving sequence of all but the first n items in coll. Returns a stateful transducer when no colle...

  • drop-last

    Return a lazy sequence of all but the last n (default 1) items in coll

  • drop-while

    Returns a lazy sequence of the items in coll starting from the first item for which (pred item) returns logical false. ...

  • eduction

    Returns a reducible/iterable application of the transducers to the items in coll. Transducers are applied in order as if...

  • filter

    Returns a lazy sequence of the items in coll for which (pred item) returns logical true. pred must be free of side-effec...

  • filterv

    Returns a vector of the items in coll for which (pred item) returns logical true. pred must be free of side-effects.

  • flatten

    Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat se...

  • for

    List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more mo...

  • frequencies

    Returns a map from distinct items in coll to the number of times they appear.

  • group-by

    Returns a map of the elements of coll keyed by the result of f on each element. The value at each key will be a vector o...

  • interleave

    Returns a lazy seq of the first item in each coll, then the second etc.

  • interpose

    Returns a lazy seq of the elements of coll separated by sep. Returns a stateful transducer when no collection is provide...

  • into

    Returns a new coll consisting of to-coll with all of the items of from-coll conjoined. A transducer may be supplied.

  • keep

    Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f mu...

  • keep-indexed

    Returns a lazy sequence of the non-nil results of (f index item). Note, this means false return values will be included....

  • map

    Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by apply...

  • map-indexed

    Returns a lazy sequence consisting of the result of applying f to 0 and the first item of coll, followed by applying f t...

  • mapcat

    Returns the result of applying concat to the result of applying map to f and colls. Thus function f should return a col...

  • mapv

    Returns a vector consisting of the result of applying f to the set of first items of each coll, followed by applying f t...

  • merge

    Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the m...

  • merge-with

    Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the m...

  • nthnext

    Returns the nth next of coll, (seq coll) when n is 0.

  • nthrest

    Returns the nth rest of coll, coll when n is 0.

  • partition

    Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. th...

  • partition-all

    Returns a lazy sequence of lists like partition, but may include partitions with fewer than n items at the end. Returns...

  • partition-by

    Applies f to each value in coll, splitting it each time f returns a new value. Returns a lazy seq of partitions. Retur...

  • random-sample

    Returns items from coll with random probability of prob (0.0 - 1.0). Returns a transducer when no collection is provide...

  • reduce

    f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in ...

  • reduce-kv

    Reduces an associative collection. f should be a function of 3 arguments. Returns the result of applying f to init, the ...

  • reductions

    Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init.

  • remove

    Returns a lazy sequence of the items in coll for which (pred item) returns logical false. pred must be free of side-effe...

  • replace

    Given a map of replacement pairs and a vector/collection, returns a vector/seq with any elements = a key in smap replace...

  • reverse

    Returns a seq of the items in coll in reverse order. Not lazy.

  • rseq

    Returns, in constant time, a seq of the items in rev (which can be a vector or sorted-map), in reverse order. If rev is ...

  • rsubseq

    sc must be a sorted collection, test(s) one of <, <=, > or >=. Returns a reverse seq of those entries with keys ek for w...

  • run!

    Runs the supplied procedure (via reduce), for purposes of side effects, on successive items in the collection. Returns n...

  • select-keys

    Returns a map containing only those entries in map whose key is in keys

  • shuffle

    Return a random permutation of coll

  • sort

    Returns a sorted sequence of the items in coll. Comp can be boolean-valued comparison function, or a -/0/+ valued compar...

  • sort-by

    Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). Comp can ...

  • split-at

    Returns a vector of [(take n coll) (drop n coll)]

  • split-with

    Returns a vector of [(take-while pred coll) (drop-while pred coll)]

  • subseq

    sc must be a sorted collection, test(s) one of <, <=, > or >=. Returns a seq of those entries with keys ek for which (te...

  • take

    Returns a lazy sequence of the first n items in coll, or all items if there are fewer than n. Returns a stateful transd...

  • take-last

    Returns a seq of the last n items in coll. Depending on the type of coll may be no better than linear time. For vector...

  • take-nth

    Returns a lazy seq of every nth item in coll. Returns a stateful transducer when no collection is provided.

  • take-while

    Returns a lazy sequence of successive items from coll while (pred item) returns logical true. pred must be free of side-...

  • transduce

    reduce with a transformation of f (xf). If init is not supplied, (f) will be called to produce it. f should be a reducin...

  • tree-seq

    Returns a lazy sequence of the nodes in a tree, via a depth-first walk. branch? must be a fn of one arg that returns tru...

  • update-keys

    m f => {(f k) v ...} Given a map m and a function f of 1-argument, returns a new map whose keys are the result of applyi...

  • update-vals

    m f => {k (f v) ...} Given a map m and a function f of 1-argument, returns a new map where the keys of m are mapped to r...