z_toposort (zotonic_core v1.0.0-rc.14)

Simple topological sort of tuples {item, [depends], [provides]}

Link to this section Summary

Functions

Return the topological sort of a list of items. Each item lists its provisions and dependencies.

Link to this section Types

-type cycles() :: [[name()]].
-type name() :: atom() | {atom(), term()}.
-type topoitem() :: {Name :: name(), Depends :: [atom()], Provides :: [atom()]}.
-type topoitems() :: [topoitem()].

Link to this section Functions

-spec sort(topoitems()) -> {ok, [name()]} | {error, {cyclic, cycles()}}.
Return the topological sort of a list of items. Each item lists its provisions and dependencies.