misaki.util.sequence documentation

Sequence utility

find-first

(find-first pred coll)(find-first pred coll default-value)
Returns the first matched entry for pred, or nil if not matched.

get-prev-next

(get-prev-next pred coll & {:keys [default], :or {default [nil nil]}})
Get previous and next element from a sequence.

some-with-default-value

(some-with-default-value pred coll default-value)
`some` function which returns specified default value if not matched.

sort-alphabetically

(sort-alphabetically ls)(sort-alphabetically f ls)(sort-alphabetically order-key f ls)
Sort list alphabetically.

sort-by-date

(sort-by-date posts)(sort-by-date f posts)(sort-by-date order-key f posts)
Sort post list with org.joda.time.DateTime