aboutsummaryrefslogtreecommitdiff
path: root/immutable.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add Makefile and move files to structured foldersEuAndreh2024-12-141-2459/+0
|
* Widen key constraint to 'any' for maps and setsOskar Haarklou Veileborg2023-01-181-40/+39
|
* list: fix Append & Prepend, remove varargs supportOskar Haarklou Veileborg2023-01-121-12/+4
| | | | Similar reason for the API change as the previous commit.
* sets & maps: remove varargs APIs & SetMany variantsOskar Haarklou Veileborg2023-01-121-19/+0
| | | | | The implementation behind the API is not more efficient than manually looping over a data structure and inserting elements one-by-one.
* Ensure immutability of sets (and maps with SetMany)Oskar Haarklou Veileborg2023-01-091-6/+4
|
* SortedMap: set multiple items at onceAm Laher2022-12-281-0/+23
|
* Fix SortedSet.Set. NewMapOf. docsAm Laher2022-12-281-0/+26
|
* List: varargs for Append,Prepend,NewListAm Laher2022-12-241-7/+19
|
* generic-widening: improve docsAm Laher2022-12-041-6/+6
|
* generics: widen map key constraint to 'comparable'Am Laher2022-12-041-42/+76
|
* Allow lists to contain non-comparable elementsOskar Haarklou Veileborg2022-11-171-30/+24
| | | | | | | | | | | | | | | | | The current design uses comparability of elements only to detect vacant entries in leaf node children lists, using the zero value of the element type as "vacant". The reason we care about vacant entries is to avoid copy operations in certain Slice calls. If the entries are not vacant, we have to "zero" the entries in the returned slice to remove references to allocated memory. Therefore, (hackily) treating the zero value as vacant works because the zero value for pointers is nil (it does not reference anything). However, requiring the list elements to be comparable is inconvenient. There shouldn't be a type bound on the elements of a general purpose list. With this change vacancy is kept track of with a bitset in list leaf nodes.
* add missing ptr types; tidyupAm Laher2022-06-111-8/+7
|
* implement generic immutable mapsAmir Laher2022-05-191-723/+382
|
* convert lists to use genericsAmir Laher2022-05-191-100/+108
|
* Refactor buildersBen Johnson2020-11-171-50/+68
| | | | | | | This commit fixes a bug in builders that caused changes to leak when building on existing collections. The builders now only work on empty list & map types and are marked as invalid after the underlying collection has been retrieved from them.
* Add additional hashers & comparers.Adrian2020-09-221-21/+432
| | | | | | | | This commit adds all int & uint type hashers & comparers. It also provides reflection-based hashers & comparers for int, uint, & string types that are wrapped with a different named type. Co-authored-by: Ben Johnson <benbjohnson@yahoo.com>
* Add ListBuilder.Len()Ben Johnson2019-03-061-0/+5
| | | | | | This commit adds a method to check the current length of a list on a `ListBuilder`. This allows the length to be checked without marking the next builder change as immutable.
* Add SortedMapBuilderBen Johnson2019-03-061-32/+161
| | | | This commit adds an efficient builder for creating SortedMap objects.
* Add MapBuilderBen Johnson2019-03-061-45/+201
| | | | | This commit provides a `MapBuilder` for efficiently combining multiple `Map` mutations.
* Add ListBuilder.Ben Johnson2019-03-041-40/+182
| | | | | | | | This commit adds a builder for more efficiently creating `List` objects. It works by mutating the list in-place until the current list is requested. After that request, the next mutation will occur on a copy but then continue to mutate in place. This allows lists to be returned and used while continuing to use the builder.
* Fix sorted map iterator initialization.Ben Johnson2019-03-021-12/+18
|
* Minor iterator refactor; update commentBen Johnson2019-03-011-8/+11
|
* (no commit message)Ben Johnson2019-03-011-0/+1864