Reply To: [Discussion] Mutability is not a problem


In the first versions of PHP4, objects were passed by copy, like arrays are now. This was infuriating to me at first, but now I think it’d be a nice thing to have back on an opt-in basis. Though it’s not a panacea when you can still do `$foo = dosomethingWith($foo)` — I’m converting a legacy codebase that does that absolutely everywhere with arrays.

Haskell only just recently managed to get linear types, so I’m thinking those might be a tall order for Psalm 🙂 Maybe just confining effects to monads, something we can get with generics alone. Well technically you need HKT’s too but there’s been a recent discovery that you can encode those with plain generics.