Hacker News new | ask | show | jobs
by jasonincanada 1536 days ago
I just coded an example usage of this monad last week:

https://github.com/jasonincanada/kattis/blob/master/src/Pivo...

This tests each element of a list to see if it's a pivot, meaning it's between the maximum to the left and the minimum to the right. In a single logical traversal it shouldn't be able to see the minimum yet, since it hasn't visited those elements. With reverse state you pretend you can anyway and let Haskell figure out the dependencies during execution