constrained-generators-0.2.0.0: Framework for generating constrained random data using a subset of first order logic
Safe HaskellSafe-Inferred
LanguageHaskell2010

Constrained.Graph

Synopsis

Documentation

data Graph node Source #

Constructors

Graph 

Fields

  • edges ∷ !(Map node (Set node))
     
  • opEdges ∷ !(Map node (Set node))
     

Instances

Instances details
Ord node ⇒ Monoid (Graph node) Source # 
Instance details

Defined in Constrained.Graph

Methods

memptyGraph node

mappendGraph node → Graph node → Graph node

mconcat ∷ [Graph node] → Graph node

Ord node ⇒ Semigroup (Graph node) Source # 
Instance details

Defined in Constrained.Graph

Methods

(<>)Graph node → Graph node → Graph node #

sconcat ∷ NonEmpty (Graph node) → Graph node

stimes ∷ Integral b ⇒ b → Graph node → Graph node

Show node ⇒ Show (Graph node) Source # 
Instance details

Defined in Constrained.Graph

Methods

showsPrec ∷ Int → Graph node → ShowS

showGraph node → String

showList ∷ [Graph node] → ShowS

Pretty n ⇒ Pretty (Graph n) Source # 
Instance details

Defined in Constrained.Graph

Methods

prettyGraph n → Doc ann Source #

prettyList ∷ [Graph n] → Doc ann Source #

nodesGraph node → Set node Source #

opGraphGraph node → Graph node Source #

subtractGraph ∷ Ord node ⇒ Graph node → Graph node → Graph node Source #

dependency ∷ Ord node ⇒ node → Set node → Graph node Source #

irreflexiveDependencyOn ∷ Ord node ⇒ Set node → Set node → Graph node Source #

transitiveDependencies ∷ Ord node ⇒ node → Graph node → Set node Source #

transitiveClosure ∷ Ord node ⇒ Graph node → Graph node Source #

noDependencies ∷ Ord node ⇒ Set node → Graph node Source #

topsort ∷ Ord node ⇒ Graph node → Either [node] [node] Source #

Topsort the graph, returning a cycle (`Left cycle`) on failure.

findCycle ∷ Ord node ⇒ Graph node → node → [node] Source #

Simple DFS cycle finding TODO: tests for this, currently it can produce a stem with a cycle after it

dependencies ∷ Ord node ⇒ node → Graph node → Set node Source #

dependsOn ∷ Ord node ⇒ node → node → Graph node → Bool Source #

deleteNode ∷ Ord node ⇒ node → Graph node → Graph node Source #