Package

com.stripe

dagon

Permalink

package dagon

Collection of graph algorithms

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. dagon
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type BoolT[T] = Boolean

    Permalink
  2. sealed class Cache[K, V] extends Serializable

    Permalink

    This is a useful cache for memoizing function.

    This is a useful cache for memoizing function.

    The cache is implemented using a mutable pointer to an immutable map value. In the worst-case, race conditions might cause us to lose cache values (i.e. compute some keys twice), but we will never produce incorrect values.

  3. sealed abstract class Dag[N[_]] extends Serializable

    Permalink

    Represents a directed acyclic graph (DAG).

    Represents a directed acyclic graph (DAG).

    The type N[_] represents the type of nodes in the graph.

  4. sealed trait Expr[N[_], T] extends Serializable

    Permalink

    Expr[N, T] is an expression of a graph of container nodes N[_] with result type N[T].

    Expr[N, T] is an expression of a graph of container nodes N[_] with result type N[T]. These expressions are like the Literal[T, N] graphs except that functions always operate with an indirection of a Id[T] where N[T] is the type of the input node.

    Nodes can be deleted from the graph by replacing an Expr at Id = idA with Var(idB) pointing to some upstream node.

    To add nodes to the graph, add depth to the final node returned in a Unary or Binary expression.

    TODO: see the approach here: https://gist.github.com/pchiusano/1369239 Which seems to show a way to do currying, so we can handle general arity

  5. trait FunctionK[T[_], R[_]] extends Serializable

    Permalink

    This is a Natural transformation.

    This is a Natural transformation.

    For any type X, this type can produce a function from T[X] to R[X].

  6. sealed class HCache[K[_], V[_]] extends Serializable

    Permalink

    This is a useful cache for memoizing natural transformations.

    This is a useful cache for memoizing natural transformations.

    The cache is implemented using a mutable pointer to an immutable map value. In the worst-case, race conditions might cause us to lose cache values (i.e. compute some keys twice), but we will never produce incorrect values.

  7. final class HMap[K[_], V[_]] extends Serializable

    Permalink

    This is a weak heterogenous map.

    This is a weak heterogenous map. It uses equals on the keys, so it is your responsibilty that if k: K[_] == k2: K[_] then the types are actually equal (either be careful or store a type identifier).

  8. final class Id[T] extends Serializable

    Permalink

    The Expressions are assigned Ids.

    The Expressions are assigned Ids. Each Id is associated with an expression of inner type T.

    This is done to put an indirection in the Dag that allows us to rewrite nodes by simply replacing the expressions associated with given Ids.

    T is a phantom type used by the type system

  9. sealed trait Literal[N[_], T] extends Serializable

    Permalink

    This represents literal expressions (no variable redirection) of container nodes of type N[T]

  10. type NeighborFn[T] = (T) ⇒ Iterable[T]

    Permalink
  11. trait PartialRule[N[_]] extends Rule[N]

    Permalink

    Often a partial function is an easier way to express rules

  12. case class RefPair[A <: AnyRef, B <: AnyRef](_1: A, _2: B) extends Product with Serializable

    Permalink

    A tuple2 that uses reference equality on items to do equality useful for caching the results of pair-wise functions on DAGs.

    A tuple2 that uses reference equality on items to do equality useful for caching the results of pair-wise functions on DAGs.

    Without this, you can easily get exponential complexity on recursion on DAGs.

  13. trait Rule[N[_]] extends Serializable

    Permalink

    This implements a simplification rule on Dags

Value Members

  1. object Cache extends Serializable

    Permalink
  2. object Dag extends Serializable

    Permalink
  3. object Expr extends Serializable

    Permalink
  4. object FunctionK extends Serializable

    Permalink
  5. object Graphs

    Permalink
  6. object HCache extends Serializable

    Permalink
  7. object HMap extends Serializable

    Permalink
  8. object Id extends Serializable

    Permalink
  9. object Literal extends Serializable

    Permalink
  10. object Memoize

    Permalink
  11. object Rule extends Serializable

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped