Module rlx_topo

This is a pretty simple topological sort for erlang.

Authors: Joe Armstrong, Eric Merritt.

Description

This is a pretty simple topological sort for erlang. It was originally written for ermake by Joe Armstrong back in '98. It has been pretty heavily modified by Eric Merritt since '06 and modified again for Relx.

A partial order on the set S is a set of pairs {Xi,Xj} such that some relation between Xi and Xj is obeyed.

A topological sort of a partial order is a sequence of elements [X1, X2, X3 ...] such that if whenever {Xi, Xj} is in the partial order i < j

Data Types

pair()

pair() = {DependentApp::atom(), PrimaryApp::atom()}

Function Index

format_error/1nicely format the error from the sort.
sort/1Do a topological sort on the list of pairs.
sort_apps/1This only does a topo sort on the list of applications and assumes that there is only *one* version of each app in the list of applications.

Function Details

format_error/1

format_error(Reason::term()) -> iolist()

nicely format the error from the sort.

sort/1

sort(Pairs::[pair()]) -> {ok, [atom()]} | relx:error()

Do a topological sort on the list of pairs.

sort_apps/1

sort_apps(Apps::[rlx_app_info:t()]) -> {ok, [rlx_app_info:t()]} | relx:error()

This only does a topo sort on the list of applications and assumes that there is only *one* version of each app in the list of applications. This implies that you have already done the constraint solve before you pass the list of apps here to be sorted.


Generated by EDoc, Jan 1 2017, 17:30:49.