Skip to content

Allow Creating Immutable Builders (Map/SortedSet/List) intialised with initial Values #45

Description

@d80tb7

Right now, `ListBuilder, MapBuilder and SortedSetBuilder) are intialised with empty data structures. This is great if you want to create an object from scratch, but doesn't cover the use case where you have an existing object and want to make a large number of modifications to it.

I propose we add functions that allow a user to create builders from initial data structures. For example:

NewSortedSetBuilderFromExisting[T any](s SortedSet[T]) *SortedSetBuilder[T] 

We would guarantee that the builder itself would mutate a copy so that the initial data structure would remain immutable.

Happy to make a PR if you think this would be useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions