diff options
author | Eduardo Julian | 2020-11-05 22:54:05 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-11-05 22:54:05 -0400 |
commit | ef78c1f92ab29c4370193591b170535dd9e743f7 (patch) | |
tree | e83fd11eb20b4df26f6f5a20bef38af9d2baac8a /stdlib/source/lux/data/collection/set/ordered.lux | |
parent | 11cc4a67001162d689eb827f755424a07b99fccb (diff) |
Improved error reporting for syntax macros.
Diffstat (limited to 'stdlib/source/lux/data/collection/set/ordered.lux')
-rw-r--r-- | stdlib/source/lux/data/collection/set/ordered.lux | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/stdlib/source/lux/data/collection/set/ordered.lux b/stdlib/source/lux/data/collection/set/ordered.lux index 8cafd922e..9884a5860 100644 --- a/stdlib/source/lux/data/collection/set/ordered.lux +++ b/stdlib/source/lux/data/collection/set/ordered.lux @@ -22,22 +22,18 @@ (All [a] (-> (Set a) a Bit)) (|> set :representation (/.contains? elem))) - (template [<name> <alias>] + (template [<type> <name> <alias>] [(def: #export <name> - (All [a] (-> (Set a) (Maybe a))) + (All [a] (-> (Set a) <type>)) (|>> :representation <alias>))] - [min /.min] - [max /.max] - ) + [(Maybe a) min /.min] + [(Maybe a) max /.max] - (template [<name> <alias>] - [(def: #export <name> - (-> (Set Any) Nat) - (|>> :representation <alias>))] + [Nat size /.size] + [Nat depth /.depth] - [size /.size] - [depth /.depth] + [Bit empty? /.empty?] ) (def: #export (add elem set) @@ -72,7 +68,9 @@ (list.filter (|>> (..member? param) not)) (..from-list (get@ #/.&order (:representation subject))))) - (structure: #export equivalence (All [a] (Equivalence (Set a))) + (structure: #export equivalence + (All [a] (Equivalence (Set a))) + (def: (= reference sample) (:: (list.equivalence (:: (:representation reference) &equivalence)) = (..to-list reference) (..to-list sample)))) |