[Haskell-cafe] Zoom instance for Coroutine

Konstantin Saveljev konstantin.saveljev at gmail.com
Fri Mar 11 07:35:34 UTC 2016


Hello,

I am using monad-coroutine
<https://hackage.haskell.org/package/monad-coroutine> package and have
something like Coroutine (Await Int) (State MyState) Int (simplified
version, for example purpose).

MyState is deeply nested and I do a lot of modifications in it. Previously
(with different data types) I was able to use zoom from lens
<https://hackage.haskell.org/package/lens>in order to simplify the
typing/view of code which operates on some subtree of the state, e.g.:

zoom (company.assets) $ do
  something.a    = someComputation  anotherthing.b = False
  this.that      = "someString"

The problem I am having is that I cannot come up with instance Zoom for the
Coroutine and was wondering if anyone is able to help me with that?

Best regards,
Konstantin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160311/42f97be9/attachment.html>


More information about the Haskell-Cafe mailing list