Skip to content
John McClean edited this page Jul 5, 2018 · 247 revisions

Cyclops X wiki

This is a work in progress. For cyclops-react 2 wiki see here

Getting started

Add cyclops X as a dependency to your project

compile 'com.oath.cyclops:cyclops:x.y.z'

Persistent Collections

The cyclops.data package contains a range of persistent (immutable shared memory) collections.

Lists

Core Lists

Interface ImmutableList

  1. Seq - a persistent linked list
  2. NonEmptyList - a persistent linked list with a least one value
  3. LazySeq - a lazy persistent linked list (like Stream in Scala or Vavr)
  4. IntMap - a persistent 'arraylist' type list backed by a PatriciaTrie
  5. Vector - a persistent 'arraylist' type list backed by a bit mapped array trie

Special Lists / List Like Data Structures

  1. LazyString
  2. HList
  3. Zipper
  4. DifferenceList

Sets

Core Sets

Interface ImmutableSet

  1. HashSet
  2. TrieSet
  3. Bag

SortedSets Sets

Interface ImmutableSortedSet

  1. TreeSet

Queues

Core Queues

Interface ImmutableQueue

  1. BankersQueue

Maps

Core Maps

Interface ImmutableMap

  1. HashMap
  2. LinkedMap
  3. TreeMap
  4. DMap

Other Collection-like Data Structures

  1. Range - represents an unconstrained generic (T) range of values
  2. Enumeration - represents an unconstrained reversible path through a generic (T) sequence of values
  3. DIET - Discrete Interval Encoded Tree

Control Structures

  1. Option : a safe optional API
  2. Maybe : a lazy and potentially reactive (asynchronous) optional type
  3. Either : a sum type representing one of two values
  4. Eval : a lazily evaluated expression, with built in memoization and stack-safe recursion (implemented via Trampoline)
  5. Try : a type-safe either/sum type that represents a success state or Exceptional state (for a more direct / powerful equivalent of Scala's Try see cyclops.reactive.IO)
  6. Validated : an either / sum type that represents Valid and Invalid states, Invalid states can be accumulated
  7. Unrestricted : a simplified Free Monad implementation for Java
  8. LazyEither/3/4/5 - a suite of lazy and potentially reactive sum types
  9. Ior - can be product of arity 2 (e.g. Tuple2 equivalent) with two values present or an either /sum type of arity two with only one of the defined types present.
  10. Future - asynchronous control type
Clone this wiki locally