Class/Object

com.stripe.dagon

Dag

Related Docs: object Dag | package dagon

Permalink

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

Represents a directed acyclic graph (DAG).

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

Self Type
Dag[N]
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Dag
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def idToExp: HMap[Id, [β$0$]Expr[N, β$0$]]

    Permalink

    These have package visibility to test the law that for all Expr, the node they evaluate to is unique

    These have package visibility to test the law that for all Expr, the node they evaluate to is unique

    Attributes
    protected
  2. abstract def roots: Set[Id[_]]

    Permalink

    The set of roots that were added by addRoot.

    The set of roots that were added by addRoot. These are Ids that will always evaluate such that roots.forall(evaluateOption(_).isDefined)

    Attributes
    protected
  3. abstract def toLiteral: FunctionK[N, [β$1$]Literal[N, β$1$]]

    Permalink

    Convert a N[T] to a Literal[T, N].

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addRoot[T](node: N[T]): (Dag[N], Id[T])

    Permalink

    Add a GC root, or tail in the DAG, that can never be deleted.

  5. lazy val allNodes: Set[N[_]]

    Permalink

    Find all the nodes currently in the graph

  6. def apply(rule: Rule[N]): Dag[N]

    Permalink

    Apply the given rule to the given dag until the graph no longer changes.

  7. def applyMax(rule: Rule[N], cnt: Int): Dag[N]

    Permalink

    Apply a rule at most cnt times.

  8. def applyOnce(rule: Rule[N]): Dag[N]

    Permalink

    apply the rule at the first place that satisfies it, and return from there.

  9. def applySeq(phases: Seq[Rule[N]]): Dag[N]

    Permalink

    Apply a sequence of rules, which you may think of as phases, in order First apply one rule until it does not apply, then the next, etc..

  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def contains(node: N[_]): Boolean

    Permalink

    Is this node in this DAG

  13. def dependenciesOf(node: N[_]): List[N[_]]

    Permalink

    What nodes do we depend directly on

  14. def dependentsOf(node: N[_]): Set[N[_]]

    Permalink

    list all the nodes that depend on the given node

  15. def depthOf[A](n: N[A]): Option[Int]

    Permalink
  16. def depthOfId[A](i: Id[A]): Option[Int]

    Permalink
  17. def ensure[T](node: N[T]): (Dag[N], Id[T])

    Permalink

    ensure the given literal node is present in the Dag Note: it is important that at each moment, each node has at most one id in the graph.

    ensure the given literal node is present in the Dag Note: it is important that at each moment, each node has at most one id in the graph. Put another way, for all Id[T] in the graph evaluate(id) is distinct.

    Attributes
    protected
  18. def ensureFast[T](lit: Literal[N, T], memo: FunctionK[[β$9$]Literal[N, β$9$], N]): (Dag[N], Id[T])

    Permalink
    Attributes
    protected
  19. def ensureRec[T](lit: Literal[N, T], memo: FunctionK[[β$10$]Literal[N, β$10$], N]): TailRec[(Dag[N], Id[T])]

    Permalink
    Attributes
    protected
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def evaluate[T](id: Id[T]): N[T]

    Permalink

    After applying rules to your Dag, use this method to get the original node type.

    After applying rules to your Dag, use this method to get the original node type. Only call this on an Id[T] that was generated by this dag or a parent.

  23. def evaluateOption[T](id: Id[T]): Option[N[T]]

    Permalink
  24. def fanOut(node: N[_]): Int

    Permalink

    Returns 0 if the node is absent, which is true use .contains(n) to check for containment

  25. def fanOut(id: Id[_]): Int

    Permalink

    Return the number of nodes that depend on the given Id, TODO we might want to cache these.

    Return the number of nodes that depend on the given Id, TODO we might want to cache these. We need to garbage collect nodes that are no longer reachable from the root

  26. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. def find[T](node: N[T]): Option[Id[T]]

    Permalink

    This finds an Id[T] in the current graph that is equivalent to the given N[T]

  28. def findAll[T](node: N[T]): LazyList[Id[T]]

    Permalink

    Nodes can have multiple ids in the graph, this gives all of them

  29. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  30. def hasSingleDependent(n: N[_]): Boolean

    Permalink

    equivalent to (but maybe faster than) fanOut(n) <= 1

  31. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  32. def idOf[T](node: N[T]): Id[T]

    Permalink

    This throws if the node is missing, use find if this is not a logic error in your programming.

    This throws if the node is missing, use find if this is not a logic error in your programming. With dependent types we could possibly get this to not compile if it could throw.

  33. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  34. def isRoot(n: N[_]): Boolean

    Permalink

    Is this node a root of this graph

  35. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. def reachableIds: Set[Id[_]]

    Permalink

    Which ids are reachable from the roots?

  39. def replaceId[A](newId: Id[A], expr: Expr[N, A], node: N[A]): Dag[N]

    Permalink
    Attributes
    protected
  40. def repointIds[A](orig: N[A], oldIds: Iterable[Id[A]], newId: Id[A], newNode: N[A]): Dag[N]

    Permalink
    Attributes
    protected
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  42. def toString(): String

    Permalink

    String representation of this DAG.

    String representation of this DAG.

    Definition Classes
    Dag → AnyRef → Any
  43. def transitiveDependenciesOf(p: N[_]): Set[N[_]]

    Permalink

    Return the transitive dependencies of a given node

  44. def transitiveDependentsOf(p: N[_]): Set[N[_]]

    Permalink

    Return all dependents of a given node.

    Return all dependents of a given node. Does not include itself

  45. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped