cats.collections

Members list

Type members

Classlikes

class AvlMap[K, V](val set: AvlSet[(K, V)])

A tree based immutable map.

A tree based immutable map.

Attributes

Companion
object
Source
Map.scala
Supertypes
class Object
trait Matchable
class Any
object AvlMap extends AvlMapInstances

Attributes

Companion
class
Source
Map.scala
Supertypes
class Object
trait Matchable
class Any
Self type
AvlMap.type

Attributes

Source
Map.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AvlMap.type
sealed abstract class AvlSet[A]

An immutable, ordered, extensional set

An immutable, ordered, extensional set

This data-structure maintains balance using the [AVL](https://en.wikipedia.org/wiki/AVL_tree) algorithm.

Attributes

Companion
object
Source
Set.scala
Supertypes
class Object
trait Matchable
class Any
object AvlSet extends AvlSetInstances

Attributes

Companion
class
Source
Set.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
AvlSet.type

Attributes

Source
Set.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AvlSet.type
sealed abstract class BitSet

A fast, immutable BitSet.

A fast, immutable BitSet.

A Bitset is a specialized type of set that tracks the Int values it contains: for each integer value, a BitSet uses a single bit to track whether the value is present (1) or absent (0). Bitsets are often sparse, since "missing" bits can be assumed to be zero.

Unlike scala's default immutable this BitSet does not do a full copy on each added value.

Internally the implementation is a tree. Each leaf uses an Array[Long] value to hold up to 2048 bits, and each branch uses an Array[BitSet] to hold up to 32 subtrees (null subtrees are treated as empty).

Bitset treats the values it stores as 32-bit unsigned values, which is relevant to the internal addressing methods as well as the order used by iterator.

The benchmarks suggest this bitset is MUCH faster than Scala's built-in bitset for cases where you may need many modifications and merges, (for example in a BloomFilter).

Attributes

Companion
object
Source
BitSet.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object BitSet

Attributes

Companion
class
Source
BitSet.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
BitSet.type
sealed abstract class Dequeue[+A]

Dequeue - A Double Ended Queue

Dequeue - A Double Ended Queue

Front Back

<- uncons --------- unsnoc -> cons -> --------- <- snoc

Based on the Bankers Double Ended Queue as described by C. Okasaki in "Purely Functional Data Structures"

A queue that allows items to be put onto either the front (cons) or the back (snoc) of the queue in constant time, and constant time access to the element at the very front or the very back of the queue. Dequeuing an element from either end is constant time when amortized over a number of dequeues.

This queue maintains an invariant that whenever there are at least two elements in the queue, neither the front list nor back list are empty. In order to maintain this invariant, a dequeue from either side which would leave that side empty constructs the resulting queue by taking elements from the opposite side

Attributes

Companion
object
Source
Dequeue.scala
Supertypes
class Object
trait Matchable
class Any
object Dequeue extends DequeueInstances

Attributes

Companion
class
Source
Dequeue.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Dequeue.type
sealed trait DequeueInstances

Attributes

Source
Dequeue.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Dequeue.type
sealed abstract class Diet[A]

Discrete Interval Encoding Tree (Diet).

Discrete Interval Encoding Tree (Diet). It stores subsets of types having a total order, a predecessor and a successor function described by Discrete[A]

Diet is a binary search tree where each node contains a range of values and the set of all nodes is a set of disjoint sets.

In the best case, when there are no "holes" in the stored set, the interval representation consists of just one single interval (node) and finding, inserting and deleting operations are O(1). In the worse case, where there are not two adjacent elements in the set, the representation is equivalent to a binary search tree.

Attributes

Companion
object
Source
Diet.scala
Supertypes
class Object
trait Matchable
class Any
object Diet

Attributes

Companion
class
Source
Diet.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Diet.type
trait Discrete[A] extends Serializable

Represent discrete operations that can be performed on A

Represent discrete operations that can be performed on A

Attributes

Companion
object
Source
Discrete.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
object Discrete

Attributes

Companion
trait
Source
Discrete.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Discrete.type
class DisjointSets[T]

Attributes

Companion
object
Source
DisjointSets.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Source
DisjointSets.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Source
DisjointSets.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object DisjointSets.type
final class HashMap[K, +V]

An immutable hash map using cats.kernel.Hash for hashing.

An immutable hash map using cats.kernel.Hash for hashing.

Implemented using the CHAMP encoding.

Type parameters

K

the type of the keys contained in this hash map.

V

the type of the values contained in this hash map.

Value parameters

hashKey

the cats.kernel.Hash instance used for hashing keys.

Attributes

See also
Companion
object
Source
HashMap.scala
Supertypes
trait IterableOnce[(K, V)]
class Object
trait Matchable
class Any
object HashMap

Attributes

Companion
class
Source
HashMap.scala
Supertypes
class Object
trait Matchable
class Any
Self type
HashMap.type
class HashMapMonoid[K, V](implicit evidence$1: Hash[K], V: Semigroup[V]) extends Monoid[HashMap[K, V]]

Attributes

Source
HashMap.scala
Supertypes
trait Monoid[HashMap[K, V]]
trait Semigroup[HashMap[K, V]]
trait Serializable
class Object
trait Matchable
class Any
Show all
final class HashSet[A]

An immutable hash set using cats.kernel.Hash for hashing.

An immutable hash set using cats.kernel.Hash for hashing.

Implemented using the CHAMP encoding.

Type parameters

A

the type of the elements contained in this hash set.

Value parameters

hash

the cats.kernel.Hash instance used for hashing values.

Attributes

See also
Companion
object
Source
HashSet.scala
Supertypes
trait IterableOnce[A]
class Object
trait Matchable
class Any
object HashSet

Attributes

Companion
class
Source
HashSet.scala
Supertypes
class Object
trait Matchable
class Any
Self type
HashSet.type

Attributes

Source
HashSet.scala
Supertypes
trait Monoid[HashSet[A]]
trait Semigroup[HashSet[A]]
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Source
HashSet.scala
Supertypes
trait Monoid[HashSet[A]]
trait Semigroup[HashSet[A]]
trait Serializable
class Object
trait Matchable
class Any
Show all
sealed abstract class Heap[A]

Heap is a Purely Functional Binary Heap.

Heap is a Purely Functional Binary Heap. Binary Heaps are not common in the functional space, especially because their implementation depends on mutable arrays in order to gain in performance. This functional binary heap is based on Vladimir Kostyukov's paper and it does support the basic operations on a heap without compromising performance.

It is important to note that we can, in fact, to create the Binary Heap in order O(n) from a List using the function heapify.

Attributes

Companion
object
Source
Heap.scala
Supertypes
class Object
trait Matchable
class Any
object Heap

Attributes

Companion
class
Source
Heap.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Heap.type
sealed abstract class PairingHeap[A]

A PairingHeap is a heap with excellent empirical performance.

A PairingHeap is a heap with excellent empirical performance.

See: https://en.wikipedia.org/wiki/Pairing_heap in particular: https://en.wikipedia.org/wiki/Pairing_heap#Summary_of_running_times

Additionally, it supports an efficient O(1) combine operation

Attributes

Companion
object
Source
PairingHeap.scala
Supertypes
class Object
trait Matchable
class Any
object PairingHeap

Attributes

Companion
class
Source
PairingHeap.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait PartiallyOrderedSet[F[_]] extends UnorderedFoldable[F]

This is a typeclass for Heap-like data-structures which are not totally ordered sets, but can produce the minimimum value, add and remove items.

This is a typeclass for Heap-like data-structures which are not totally ordered sets, but can produce the minimimum value, add and remove items.

Attributes

Companion
object
Source
PartiallyOrderedSet.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
PartiallyOrderedSet.scala
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class Predicate[-A] extends A => Boolean

An intensional set, which is a set which instead of enumerating its elements as a extensional set does, it is defined by a predicate which is a test for membership.

An intensional set, which is a set which instead of enumerating its elements as a extensional set does, it is defined by a predicate which is a test for membership.

Attributes

Companion
object
Source
Predicate.scala
Supertypes
trait A => Boolean
class Object
trait Matchable
class Any
Self type
object Predicate extends PredicateInstances

Attributes

Companion
class
Source
Predicate.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Predicate.type

Attributes

Source
Predicate.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Predicate.type
final case class Range[A](start: A, end: A)

Represent an inclusive range [x, y] that can be generated by using discrete operations

Represent an inclusive range [x, y] that can be generated by using discrete operations

Attributes

Companion
object
Source
Range.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Range

Attributes

Companion
class
Source
Range.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Range.type
sealed abstract class TreeList[+A]

Implementation of "Purely Functional Random Access Lists" by Chris Okasaki.

Implementation of "Purely Functional Random Access Lists" by Chris Okasaki. This gives O(1) cons and uncons, and 2 log_2 N lookup.

A consequence of the log N complexity is that naive recursion on the inner methods will (almost) never blow the stack since the depth of the structure is log N, this greatly simplifies many methods. A key example is that unlike List, using a TreeList you can sequence and traverse very large lists without blowing the stack since the stack depth is only log N.

This data-structure is useful when you want fast cons and uncons, but also want to index. It does not have an optimized concatenation.

Attributes

Companion
object
Source
TreeList.scala
Supertypes
class Object
trait Matchable
class Any
object TreeList

Attributes

Companion
class
Source
TreeList.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
TreeList.type

Deprecated types

type ISet[K] = Predicate[K]

Attributes

Deprecated
true
Source
package.scala

Value members

Deprecated fields

val ISet: Predicate.type

Attributes

Deprecated
true
Source
package.scala