diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/collection/set.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/lux/data/collection/set.lux b/stdlib/source/lux/data/collection/set.lux index 6de27eb24..01a588cc1 100644 --- a/stdlib/source/lux/data/collection/set.lux +++ b/stdlib/source/lux/data/collection/set.lux @@ -7,7 +7,7 @@ [data [collection ["dict" dictionary (#+ Dictionary)] - ["." list ("list/." Fold<List>)]]] + ["." list ("list/." fold)]]] [type abstract]]) @@ -53,18 +53,18 @@ (:abstraction (dict.select (dict.keys (:representation filter)) (:representation base)))) - (structure: #export Equivalence<Set> (All [a] (Equivalence (Set a))) + (structure: #export equivalence (All [a] (Equivalence (Set a))) (def: (= reference sample) - (let [[Hash<a> _] (:representation reference)] - (:: (list.Equivalence<List> (get@ #hash.eq Hash<a>)) = + (let [[hash _] (:representation reference)] + (:: (list.equivalence (get@ #hash.&equivalence hash)) = (..to-list reference) (..to-list sample))))) - (structure: #export Hash<Set> (All [a] (Hash (Set a))) - (def: eq ..Equivalence<Set>) + (structure: #export hash (All [a] (Hash (Set a))) + (def: &equivalence ..equivalence) (def: (hash set) - (let [[Hash<a> _] (:representation set)] - (list/fold (function (_ elem acc) (n/+ (:: Hash<a> hash elem) acc)) + (let [[hash _] (:representation set)] + (list/fold (function (_ elem acc) (n/+ (:: hash hash elem) acc)) 0 (..to-list set))))) ) @@ -73,9 +73,9 @@ (All [a] (-> (Set a) Bit)) (|>> ..size (n/= 0))) -(def: #export (from-list Hash<a> xs) +(def: #export (from-list hash elements) (All [a] (-> (Hash a) (List a) (Set a))) - (list/fold ..add (..new Hash<a>) xs)) + (list/fold ..add (..new hash) elements)) (def: #export (sub? super sub) (All [a] (-> (Set a) (Set a) Bit)) |