ham-fisted.protocols

BitSet

protocol

Protocol for efficiently dealing with bitsets

members

bitset?

(bitset? item)

contains-range?

(contains-range? item sidx eidx)

intersects-range?

(intersects-range? item sidx eidx)

max-set-value

(max-set-value item)

min-set-value

(min-set-value item)

BulkSetOps

protocol

members

reduce-intersection

(reduce-intersection l data)

reduce-union

(reduce-union l data)

Finalize

protocol

Generic protocol for things that finalize results of reductions. Defaults to deref of instance of IDeref or identity.

members

finalize

(finalize this val)

PAdd

protocol

Define a function to mutably add items to a collection. This function must return the collection -- it must be useable in a reduction.

members

add-fn

(add-fn l)

ParallelReducer

protocol

Parallel reducers are simple a single object that you can pass into preduce as opposed to 3 separate functions.

members

->merge-fn

(->merge-fn item)

Returns the merge function for a parallel reduction. This function takes two accumulators and returns a or modified accumulator.

ParallelReduction

protocol

Protocol to define a parallel reduction in a collection-specific pathway. Specializations are in impl as that is where the parallelization routines are found.

members

preduce

(preduce coll init-val-fn rfn merge-fn options)

Container-specific parallelized reduction. Reductions must respect the pool passed in via the options.

Reducer

protocol

Reducer is the basic reduction abstraction as a single object.

members

->init-val-fn

(->init-val-fn item)

Returns the initial values for a parallel reduction. This function takes no arguments and returns the initial accumulator.

->rfn

(->rfn item)

Returns the reduction function for a parallel reduction. This function takes two arguments, the accumulator and a value from the collection and returns a new or modified accumulator.

Reduction

protocol

Faster check than satisfies? to see if something is reducible

members

reducible?

(reducible? coll)

SetOps

protocol

Simple protocol for set operations to make them uniformly extensible to new objects.

members

cardinality

(cardinality item)

Some sets don't work with clojure's count function.

contains-fn

(contains-fn item)

Return an efficient function for deciding if this set contains a single item.

difference

(difference l r)

intersection

(intersection l r)

set?

(set? l)

union

(union l r)

xor

(xor l r)

ToCollection

protocol

members

->collection

(->collection item)

convertible-to-collection?

(convertible-to-collection? item)

ToIterable

protocol

members

->iterable

(->iterable item)

convertible-to-iterable?

(convertible-to-iterable? item)

WrapArray

protocol

members

wrap-array

(wrap-array ary)

wrap-array-growable

(wrap-array-growable ary ptr)