4 ms·
Yes but if you represent 2 functions over some state a(s) and b(s) then you have the same issue with this as if it was: Class s: fun a(self)... fun b(s
by sirsinsalot 4y ago
Yes but if you represent 2 functions over some state a(s) and b(s) then you have the same issue with this as if it was:
Class s:
fun a(self)...
fun b(self)...
The problem is mutability not how state is bound to a function.
- JanisErdmanis 4y agoThe idea is to make the functions pure and return the state ‘a(s_1) -> s_2, value’. Makes so much easier to test and write concurrent programs. Though it’s not always practical, like when needing to push an element to an array for making updated state. It is nevertheless possible to shave of pure parts considerably making mutability easier to maintain.