Commit Graph
16 Commits
Author SHA1 Message Date
Karoy Lorentey b9ea3f0dd3 [BitSet] Add Custom[Debug]StringConvertible, CustomReflectable conformances 2022-08-26 14:21:15 -07:00
Karoy Lorentey 1217b3289a [BitSet] Fix index offsetting 2022-08-26 01:04:18 -07:00
Karoy Lorentey 54d47c1e23 [BitSet] Add docs. 2022-08-26 00:09:13 -07:00
Karoy Lorentey fcac09d86a [BitSet, BitArray] Add random factories 2022-08-25 22:21:34 -07:00
Karoy Lorentey 65976b8d85 [BitSet] Add some docs. 2022-08-25 20:26:48 -07:00
Karoy Lorentey 1aed39e0c6 [BitSet] Implement fancy index methods 2022-08-25 20:26:48 -07:00
Karoy Lorentey 3642c26f58 [BitSet] Use standard temporary allocation facility when available 2022-08-17 13:49:07 -07:00
Karoy Lorentey d8d9c5ea25 [BitSet] Add documentation 2022-08-16 19:01:11 -07:00
Karoy Lorentey da84296b9b [BitSet] Add custom sorted(), returning self 2022-08-16 15:53:06 -07:00
Karoy Lorentey 4cb8ecebee [BitSet] Add new initializers (from words & bit arrays) 2022-08-16 15:44:13 -07:00
Karoy Lorentey cbf933665b [BitSet] Revert to non-generic BitSet
Also, remove members that were generic over FixedWidthInteger.
2022-08-12 19:22:24 -07:00
Károly Lőrentey 1d1fbc82d4 [BitSet] Make BitSet generic over its Element
This gets rid of the weird asymmetry between reading the contents of a BitSet (where we used to always get Int values) and mutating it (where we used to be able to give it values fo any fixed-width integer type).
2022-07-30 23:25:53 -07:00
Karoy Lorentey d890b35cb2 [BitSet] Fix typo in filename 2022-06-20 12:54:53 -07:00
Karoy Lorentey 565c09e8d5 Review & update BitArray 2022-02-06 22:38:35 -08:00
Károly Lőrentey 8f2e0c79c3 Review & update BitSet
This is a work in progress; in particular, it adds a cached `count` to BitSet, which may turn out to be a bad idea. (It generates extra work for bulk operations even if the count is never needed.) I think replacing this with a cached `startIndex` might be more useful in practice.

The `_UnsafeBitset` type from the OrderedCollections module is brought over as `BitSet._UnsafeHandle`. This implements an (internal-only) fixed-size bitset.

`BitSet` now conforms to `SetAlgebra`. We decided against this in the initial implementation, but on reflection, it seems like the right move. (The somewhat nonsensical `insert` and `update` methods are unfortunate, but consistency is valuable.)
2022-01-10 23:35:33 -08:00
Károly Lőrentey 537382f2a6 BitArrayModule ⟹ BitCollections 2021-12-28 15:45:38 -08:00