hydra-0.5.1: Type-aware transformations for data and programs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hydra.Tools.Sorting

Description

Utilities for sorting

Synopsis

Documentation

topologicalSort :: Ord a => [(a, [a])] -> Either [[a]] [a] Source #

Sort a directed acyclic graph (DAG) based on an adjacency list Yields a list of nontrivial strongly connected components if the graph has cycles

topologicalSortComponents :: Ord a => [(a, [a])] -> [[a]] Source #

Find the strongly connected components (including cycles and isolated vertices) of a graph, in (reverse) topological order

initGraph :: Ord a => [(a, [a])] -> (Graph, Vertex -> ((), a, [a])) Source #