unordered-containers has a totally unsafe insertion function used to implement fromList and similar by mutating "immutable" maps with the help of unsafeThaw and unsafeFreeze. We could do something similar here, and use it to implement fromList, filter, and partition. This would avoid rebuilding a tree node just because one of its children has changed. Is it worth the trouble? I don't know yet.
unordered-containers
has a totally unsafe insertion function used to implementfromList
and similar by mutating "immutable" maps with the help ofunsafeThaw
andunsafeFreeze
. We could do something similar here, and use it to implementfromList
,filter
, andpartition
. This would avoid rebuilding a tree node just because one of its children has changed. Is it worth the trouble? I don't know yet.