Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Utilities for sorting
Synopsis
- topologicalSort :: Eq a => [(a, [a])] -> Maybe [a]
Documentation
topologicalSort :: Eq a => [(a, [a])] -> Maybe [a] Source #
Sort a directed acyclic graph (DAG) based on an adjacency list Note: assumes that the input is in fact a DAG; the ordering is incomplete in the presence of cycles.