On 01/01/2021 20:31, Paul M. Jones wrote:
The complaints against the incomplete and inconsistent immutability of PSR-7 have merit.
The big mistake of PSR-7, in my view, is mixing immutable objects with streams, which are inherently mutable/stateful. I wonder if there are any lessons to be learned there in terms of what kinds of immutability the language should encourage / make easy.
For instance, is it better to constrain entire objects to be immutable rather than individual properties? And should there be restrictions on what you can declare as immutable, since "immutable resource" is largely nonsensical?
Or is it rather a reflection that building purely immutable implementations is hard, and the language needs other facilities (monads? ownership?) to mix in those parts that don't fit?
Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php