Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently `accumL` uses `mapL` to read the previous state whenever the state update `Pulse` fires. This is problematic, because when the previous state is read in `mapL` (and transformed into a `(a -> a) -> a` function), this is cached into the `Latch`. This means that when the state update `Pulse` fires, we'll update one latch to the new state, while also retaining the previous state. This commit redefines `accumL` as a call to `newLatch` (as before) and creates a new `Pulse` with `newPulse` whose evaluation function reads the `Pulse` containing the `a -> a` endmorphism, and also reads the current state from its latch. With this implementation, no historic values are leaked by `accumL`.
- Loading branch information