purescript-graphs
purescript-graphs copied to clipboard
Partial constraint on topologicalSort
If the graph contains cycles, then the behavior is undefined.
Should there be a Partial constraint?
An alternative is to make sure the function is total and then change the documentation to:
If the graph contains cycles, an unspecified value is returned.
As I understand, the function is total, but if there are cycles in the input graph then the resulting list of keys is wrong, so the latter might be a better option.