diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/collection/set/ordered.lux | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/lux/data/collection/set/ordered.lux b/stdlib/source/lux/data/collection/set/ordered.lux index 68449daa3..71183d2e4 100644 --- a/stdlib/source/lux/data/collection/set/ordered.lux +++ b/stdlib/source/lux/data/collection/set/ordered.lux @@ -41,42 +41,42 @@ (All [a] (-> a (Set a) (Set a))) (|> set :representation (/.remove elem) :abstraction)) - (def: #export to-list + (def: #export to_list (All [a] (-> (Set a) (List a))) (|>> :representation /.keys)) - (def: #export (from-list &order list) + (def: #export (from_list &order list) (All [a] (-> (Order a) (List a) (Set a))) (list\fold add (..new &order) list)) (def: #export (union left right) (All [a] (-> (Set a) (Set a) (Set a))) - (list\fold ..add right (..to-list left))) + (list\fold ..add right (..to_list left))) (def: #export (intersection left right) (All [a] (-> (Set a) (Set a) (Set a))) - (|> (..to-list right) + (|> (..to_list right) (list.filter (..member? left)) - (..from-list (get@ #/.&order (:representation right))))) + (..from_list (get@ #/.&order (:representation right))))) (def: #export (difference param subject) (All [a] (-> (Set a) (Set a) (Set a))) - (|> (..to-list subject) + (|> (..to_list subject) (list.filter (|>> (..member? param) not)) - (..from-list (get@ #/.&order (:representation subject))))) + (..from_list (get@ #/.&order (:representation subject))))) (structure: #export equivalence (All [a] (Equivalence (Set a))) (def: (= reference sample) (\ (list.equivalence (\ (:representation reference) &equivalence)) - = (..to-list reference) (..to-list sample)))) + = (..to_list reference) (..to_list sample)))) ) (def: #export (sub? super sub) (All [a] (-> (Set a) (Set a) Bit)) (|> sub - ..to-list + ..to_list (list.every? (..member? super)))) (def: #export (super? sub super) |