brainrape/elm-arc-diagram/1.0.0

NOTE: the latest version is 2.0.0

Renamed to brainrake/elm-arc-diagram. It is published under that name, and new versions come out there.

Versions published as brainrape/elm-arc-diagram still install under that name. 1 version of 2 come from the new location (see their notes). 1 version could not be recovered and cannot be installed.

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/brainrake/elm-arc-diagram.

What we checked: The repo moved to github.com/brainrake/elm-arc-diagram. Rebuilt with git archive from commit 39d251a5a3ba of https://github.com/brainrake/elm-arc-diagram (zip prefix brainrape-elm-arc-diagram-39d251a/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 140e0db274cfc1a962cc8e2bed6fcc49a661bc64.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/brainrape/elm-arc-diagram/zipball/1.0.0/

AcyclicDigraph

Type aliases

The following type aliases are used to make type annotations more meaningful.

type alias Node =
Int
type alias Edge =
( Node, Node )
type alias Cycle =
List Node

AcyclicDigraph

Represents a directed graph with no cycles.

fromEdges : Set Edge -> Result (List Cycle) AcyclicDigraph

From a directed graph represented as a set of edges, get an AcyclicDigraph if the graph has no cycles; otherwise, get a list of all its simple cycles.

toEdges : AcyclicDigraph -> Set Edge

From an AcyclicDigraph, get its representation as a set of edges.

Topological sorting

topologicalRank : AcyclicDigraph -> Dict Node Int

Get a dictionary mapping node to topological rank. Rank numbering starts at 1 for all source nodes.

topologicalSortBy : (Node -> comparable) -> Dict Node Int -> List Node

From topologically-ranked nodes, get a well-ordered list of nodes by providing a (Node -> comparable) function to sort same-ranked nodes by.