Closed kkm000 closed 9 years ago
I spent some time thinking about this and I actually like my version a bit better. Though I can see why it does not work for everyone.
The main reason is that it shows the symmetry in the case when one is SetNop
and the other is Set
- and then it shows (on the line 2) how the conflicting situation is resolved.
In any case, thanks for reading and for the suggestion!
Hi Tomas, I just read your excellent post on the update monad. I stumbled for a few long minutes, though, trying to understand why a \circ b of the
StateUpdate
is so symmetrical unless both a and b are not noops, before I realized it actually isn't! May I suggest a rewrite in this explicitly asymmetric form? To me, this form seems easier to understand: left to right,SetNop
passesv
through, butSet b
prevails.Technically, the second case could have been written as
| _, v -> v
, but that would be didactically wrong, I think :)