The state modifications are both happening, if i inspect it after the 2nd
function does an update the change is there, but the wind out of the return
value from the first function is a different object, and immutability is
giving me it before the 2nd update, which is a discarded object.
I am se
based on what you posted to stack overflow I would guess it's because the
side-effects (the prints) are coming too soon---you have a println as the
first line of check-k-v, so if the expression (mplus (check-k-v ...)
(check-k-v ...)) is evaluated, then, given that mplus is not a macro, both
argumen
It's difficult to see how it's a chunked issue, the original code is just
calling monadic functions, the only map is the state (the latter part of my
post was an attempt to manually recreate what the monad macros are doing
and I'm sure i didn't do a perfect job of it).
It's my understanding tha
It sounds like you're running into the chunked sequence behavior of
map (it's lazy but it realizes chunks of the sequence for efficiency
rather than strictly on-demand).
I'd say the possibilities are: don't use side-effecting functions in
your monads or define a fully lazy version of map and defin