04:43 | <ljharb> | I am still suspicious of any R&T use cases that are drop-in replacement of objects but with deep immutability and/or equality semantics. In both cases the fact that the structure has to be deeply immutable, aka no objects directly contained, makes me believe that the code will have to be aware the value is a R/T and handle it explicitly. |
05:28 | <Mathieu Hofman> | Because some things by definition cannot be inside R&T, like functions or class instances. If you take the often cited examples of options bag or react props, R&T would could only be used in a subset of cases. That is why I said R&T are not a drop-in replacement for an immutable object. Not having Box makes them particularly unfit for the above examples as now a coordination Map needs to be used as well alongside. |
17:14 | <ljharb> | In react they wouldn’t be the props object - which has to remain an object so it can contain functions - they’d be the props themselves, which are quite often primitives and lists of primitives |