These are chat archives for dry-rb/chat

2nd
Jun 2017
Pablo Herrero
@pabloh
Jun 02 2017 01:02
What do you guys use if you need something that behaves like an immutable Hash?
Pablo Herrero
@pabloh
Jun 02 2017 13:57
Basically something that follows (somewhat) the same protocol as Hash but, calling update, merge,transform_keys, flatten, etc...; won't always return you unfrozen (mutable) instances like Hash does.
Rafael George
@cored
Jun 02 2017 14:26
@pabloh why don't you make your object inmutable and every time somebody call those methods just create a new one of your inmutable hashes and return it at the end of the update, merge or whatever?
that will create new instances instead of mutating the oen that you are refearing to each time