: find-source ( seq -- elt )
unzip diff prune
- dup empty? [ "Topological sort failed" throw ] [ first ] if ;
+ [ "Topological sort failed" throw ] [ first ] if-empty ;
: remove-source ( seq elt -- seq )
[ swap member? not ] curry filter ;
dup length 1 > [
dup find-source dup , remove-source (topological-sort)
] [
- dup empty? [ drop ] [ first [ , ] each ] if
+ [ first [ , ] each ] unless-empty
] if ;
PRIVATE>