This repository was archived by the owner on May 24, 2025. It is now read-only.
Releases: Cantido/int_set
Releases · Cantido/int_set
2.0.0
I was able to introduce some pretty hefty optimizations that eliminated the need for a lot of the manual bit-twiddling this library was doing. Benchmarks show a massive improvement in speed and memory usage. I didn't check any benchmarks in because running them seems to crash my machine 😭.
Changed
- Inspecting an IntSet now returns a string using
IntString.new([1, 2, 3, ...])syntax. - The internal binary that IntSet uses to store values is now always byte-aligned, and each byte has changed endianness to allow for some internal optimizations.
- Binaries returned by
IntSet.bitstring/1is now always byte-aligned.
Removed
- BREAKING: The
byte_alignoption forIntSet.bitstring/1was removed.
1.5.2
Added
- Copyright headers are now on all files, following the REUSE Specification.
Changed
- Fixes for Elixir 1.14 deprecations
- The project now uses Earthly for CI. You can run the entire CI pipeline on your local machine by installing Earthly and running earthly +all.
1.5.1
Byte-aligned bitstrings
Changed
IntSet.bitstring/1is nowIntSet.bitstring/2and now accepts an option::byte_align.
When this option is set totrue, the bitstring is padded at the end to make it byte-aligned.
Add inverse/1
Added
- The
IntSet.inverse/2function, which is like taking the difference of your IntSet with a completely-full IntSet with n members.
Say you have a list of indices, and you want to create a list of all the indices you don't have.
Just take the inverse, providing a member limit. - Added an
.editorconfigfile to the project.
Typespecs and optimizations
Added
IntSet.difference/2now has a typespec.IntSet.disjoint?/2now has docs and a typespec.
Changed
IntSet.union/2has been optimized
Add difference/2 and disjoint/2
Added
- The
IntSet.difference/2function.
This function subtracts set B's members from set A. - The
IntSet.disjoint?/2function.
Returnstrueif sets A and B have no members in common.
Changed
- The
Collectableimplementation was dramatically optimized.
Typespecs, optimizations, and bitstring/1
Added
- The
IntSet.bitstring/1function.
Returns a binary with bits flipped at the indices at which the set has members.
For example, say you have a set containing 0, 1, and 4.
CallingIntSet.bitstring/1on that set will return a five-bit-long binary with the first, second, and fifth bits set to 1, and the rest are 0. - The library is now typespecced and documented.
Initial Release
Added
- Constructor
IntSet.new/0, which creates a new empty set. - Constructor
IntSet.new/1, which accepts either an enumerable and returns a set containing those elements.
This constructor also accepts a bitstring.
See the documentation for details on that behavior. - The
IntSet.put/2function.
Just likeMapSet.put/2, this function returns a new set with the given value added. - The
IntSet.delete/2function.
Again, just likeMapSet.delete/2.
Returns a new set with the given value removed. - The
IntSet.union/2function.
Returns a set that contains elements of both given sets. - An implementation of
Inspectthat sorts members before printing them,
so the order can be relied upon in doctests. - An implementation of
Collectable. - An implementation of
Enumerable.
More bugfixes to inverse/2
Fixed
IntSet.inverse/2is now totally fixed.