Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Have mutable and immutable variants #2

Open
schnittchen opened this issue Aug 27, 2017 · 2 comments
Open

Have mutable and immutable variants #2

schnittchen opened this issue Aug 27, 2017 · 2 comments

Comments

@schnittchen
Copy link
Owner

...and remove .new for clarity.

@schnittchen
Copy link
Owner Author

This should highlight the main use case, as a value object type.

I'm not really happy with using the word immutable:

  • Users can add mutation in a do block and should be free to do that (so, freezeing is not an option)
  • Nested values will always be mutable as long as values are not deeply frozen

Alternatives for the word immutable in this context are highly appreciated.

@schnittchen
Copy link
Owner Author

Technically, .new can be replaced with two methods, one (the "immutable" semantics, see above) not adding setters. This is the only change I would introduce, and this mode should also be the default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant