(@ sort list @compare .sorted +-
    (# sort list SORT_ASC compare .sorted)
+
    {list : <T>} list
    {list : <T> : [list]} sorted
)

(@ sort:rc list order-by @compare .sorted +-
    (' .lesser .greater ..)
    (detach -e list 1st others)
    (.* others x >
        ([# compare] x 1st order-by >
            (attach greater x)
        >
            (attach lesser x)
        )
    )
    ([list] >
        (attach sorted ls-sorted 1st gt-sorted -
            (# sort lesser compare order-by .ls-sorted
             # sort greater compare order-by .gt-sorted)
        )
    )
+
    {SORT_* : {ASC DESC}} order-by
)






