Hey there!
I had a similar idea a while ago, but realized that without operator overloading this isn't a complete abstraction. Eg.
import{Map}from'immutable-proxy'consta=newMap({b: 1})a.b=2assert(a.b==2)// we just mutated a!If we had operator overloading, we could do this, though it feels strange in JS:
import{Map}from'immutable-proxy'consta=newMap({b: 1})constb=a.b=2assert(a.b==1)assert(b.b==2)assert(a!=b)Anyway, I ended up with this proof of concept: https://github.com/bcherny/auditable - mutable datatypes, backed by immutable data structures.
Hey there!
I had a similar idea a while ago, but realized that without operator overloading this isn't a complete abstraction. Eg.
If we had operator overloading, we could do this, though it feels strange in JS:
Anyway, I ended up with this proof of concept: https://github.com/bcherny/auditable - mutable datatypes, backed by immutable data structures.