Liking cljdoc? Tell your friends :D

hara.data.base.seq


all-unique?clj

(all-unique? coll)

checks if elements in the collection are unique

(all-unique? [1 2 3 4]) => true

(all-unique? [1 2 1 4]) => false

checks if elements in the collection are unique

(all-unique? [1 2 3 4])
=> true

(all-unique? [1 2 1 4])
=> false
raw docstring

conj-uniqueclj

(conj-unique coll x)

assumes vector is a set, adding only unique elements

(conj-unique [1 2 3] 1) => [1 2 3]

(conj-unique [1 2 3] 4) => [1 2 3 4]

assumes vector is a set, adding only unique elements

(conj-unique [1 2 3] 1)
=> [1 2 3]

(conj-unique [1 2 3] 4)
=> [1 2 3 4]
raw docstring

element-ofclj

(element-of pred coll)

finds the element within an array

(element-of keyword? [1 2 :hello 4]) => :hello

finds the element within an array

(element-of keyword? [1 2 :hello 4])
=> :hello
raw docstring

flatten-allclj

(flatten-all x)

flattens all elements the collection

(flatten-all [1 2 #{3 {4 5}}]) => [1 2 3 4 5]

flattens all elements the collection

(flatten-all [1 2 #{3 {4 5}}])
=> [1 2 3 4 5]
raw docstring

index-ofclj

(index-of pred coll)

finds the index of the first matching element in an array

(index-of even? [1 2 3 4]) => 1

(index-of keyword? [1 2 :hello 4]) => 2

finds the index of the first matching element in an array

(index-of even? [1 2 3 4]) => 1

(index-of keyword? [1 2 :hello 4]) => 2
raw docstring

insert-indexclj

(insert-index coll i new)
(insert-index coll i new & more)

insert one or more elements at the given index

(insert-index [:a :b] 1 :b :c) => [:a :b :c :b]

insert one or more elements at the given index

(insert-index [:a :b] 1 :b :c)
=> [:a :b :c :b]
raw docstring

moveclj

(move coll from to)

moves item from one index to the other

(move [1 2 3 4] 1 3) => [1 3 4 2]

moves item from one index to the other

(move [1 2 3 4] 1 3)
=> [1 3 4 2]
raw docstring

move-downclj

(move-down coll i)
(move-down coll i step)

move item at index i down step positions

(move-down [1 2 3 4] 0) => [2 1 3 4]

move item at index `i` down `step` positions

(move-down [1 2 3 4] 0)
=> [2 1 3 4]
raw docstring

move-down?clj

(move-down? coll i)
(move-down? coll i step)

checks if item at index i can move down

(move-down? [1 2 3 4] 0) => true

checks if item at index `i` can move down

(move-down? [1 2 3 4] 0)
=> true
raw docstring

move-swapclj

(move-swap coll i j)

swaps items in list around

(move-swap [1 2 3 4] 2 3) => [1 2 4 3]

swaps items in list around

(move-swap [1 2 3 4] 2 3)
=> [1 2 4 3]
raw docstring

move-upclj

(move-up coll i)
(move-up coll i step)

move item at index i up step positions

(move-up [1 2 3 4] 3) => [1 2 4 3]

move item at index `i` up `step` positions

(move-up [1 2 3 4] 3)
=> [1 2 4 3]
raw docstring

move-up?clj

(move-up? coll i)
(move-up? coll i step)

checks if item at index i can move up

(move-up? [1 2 3 4] 0) => false

checks if item at index `i` can move up

(move-up? [1 2 3 4] 0)
=> false
raw docstring

move?clj

(move? coll from to)

can move item from one index to the other

(move? [1 2 3 4] 1 3) => true

can move item from one index to the other

(move? [1 2 3 4] 1 3)
=> true
raw docstring

positionsclj

(positions pred coll)

find positions of elements matching the predicate

(positions even? [5 5 4 4 3 3 2 2]) => [2 3 6 7]

find positions of elements matching the predicate

(positions even? [5 5 4 4 3 3 2 2])
=> [2 3 6 7]
raw docstring

remove-indexclj

(remove-index coll i)
(remove-index coll i n)

removes element at the specified index

(remove-index [:a :b :c :d] 2) => [:a :b :d]

removes element at the specified index

(remove-index [:a :b :c :d] 2)
=> [:a :b :d]
raw docstring

seqifyclj

(seqify x)

converts an individual element into a sequence

(seqify 1) => [1]

(seqify [1 2 3]) => [1 2 3]

converts an individual element into a sequence

(seqify 1)
=> [1]

(seqify [1 2 3])
=> [1 2 3]
raw docstring

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

× close