[Haskell-cafe] Question on nested State monads.
Benjamin Edwards
edwards.benj at gmail.com
Sun Dec 29 16:33:31 UTC 2013
(Forwarding to the list, sorry Albert)
On Sunday, 29 December 2013 08:32:06, Benjamin Edwards <
edwards.benj at gmail.com> wrote:
I would also recommend looking at use / zoom from the lens package. I find
them indispensable for when you want to use a compound state. If you just
have two parts you can write all your state calculations on the separate
parts then user StateT m (a,b) r and zoom _1 / zoom _2 to access them in
the same do block.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131229/d3e0c483/attachment.html>
More information about the Haskell-Cafe
mailing list