You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
For collection types, Nickel supports: records, dictionary, arrays, but one common structure missing is Set, an unordered collection like an array where all values must be unique. Uniqueness can prevent certain kinds of errors where the consumer should need to consider duplicate values, but also comes with a grab bag of handy combinators like union, intersect, difference, merge, etc.
Describe the solution you'd like
Add a new data type: Set T + stdlib module std-set
Describe alternatives you've considered
Making a bunch of contracts around Array T.
Additional context
This is a common data structure in most languages. It’s been a long personal pain point with its absence in JSON, however alternatives like EDN do support it. Being able to assert a JSON Array as a Set would be very useful.
The text was updated successfully, but these errors were encountered:
I wonder, do you want a builtin type Set that would be natively handled by Nickel, or some kind of standard library module that implements Set using more basic constructions? Or, maybe, you don't care and just want Set 🙂
Weighing in here as someone who also encountered use cases for Set, I believe a native implementation would be nicer, though the only reason I could think of is performance.😂
Is your feature request related to a problem? Please describe.
For collection types, Nickel supports: records, dictionary, arrays, but one common structure missing is
Set
, an unordered collection like an array where all values must be unique. Uniqueness can prevent certain kinds of errors where the consumer should need to consider duplicate values, but also comes with a grab bag of handy combinators likeunion
,intersect
,difference
,merge
, etc.Describe the solution you'd like
Add a new data type:
Set T
+stdlib
modulestd-set
Describe alternatives you've considered
Making a bunch of contracts around
Array T
.Additional context
This is a common data structure in most languages. It’s been a long personal pain point with its absence in JSON, however alternatives like EDN do support it. Being able to assert a JSON Array as a Set would be very useful.
The text was updated successfully, but these errors were encountered: