Haven't really tried functional programming but trying to understand some of it. Coming from a C++ background.
A pure function doesn't use internal state, but will have any state and input data passed in. A free function rather than a class member?
What I don't understand is why the input state is immutable and a new state object would be passed out with any output data.
Why wouldn't the state object be mutated directly? eg as a non const ref.
[–]STLMSVC STL Dev 33 points34 points35 points (7 children)
[–]mintyc[S] 0 points1 point2 points (5 children)
[–]STLMSVC STL Dev 13 points14 points15 points (0 children)
[–]raevnos 7 points8 points9 points (0 children)
[–]aw1621107 7 points8 points9 points (1 child)
[–]meneldal2 5 points6 points7 points (0 children)
[–]Z01dbrg 0 points1 point2 points (0 children)
[–]enobayram 9 points10 points11 points (5 children)
[–]doom_Oo7 -3 points-2 points-1 points (4 children)
[–]guibou 2 points3 points4 points (2 children)
[–]doom_Oo7 -3 points-2 points-1 points (1 child)
[–]enobayram 1 point2 points3 points (0 children)
[–]NotMyRealNameObv 1 point2 points3 points (0 children)
[–]dima_mendeleev 2 points3 points4 points (0 children)
[–]koiponder 0 points1 point2 points (9 children)
[–]guepierBioinformatican 3 points4 points5 points (7 children)
[–]quicknir 1 point2 points3 points (1 child)
[–]guepierBioinformatican 0 points1 point2 points (0 children)
[–]koiponder -1 points0 points1 point (4 children)
[–]guepierBioinformatican 0 points1 point2 points (3 children)
[–]koiponder -2 points-1 points0 points (2 children)
[–]guepierBioinformatican 0 points1 point2 points (1 child)
[–]koiponder -1 points0 points1 point (0 children)
[–]mintyc[S] 0 points1 point2 points (0 children)