Description
Optics for Polysemy.
Description
Optics for interfacing with Reader, State, and Writer effects in Polysemy.
README.md
Usage
Simply import Optics.Polysemy
. This serves as a drop-in replacement for Optics
, Optics.State
, and Optics.State.Operators
.
Caveats
As best I can tell, the zoom
functions cannot currently be translated with complete precision. As a result, only a few zoom
functions are present here, and they behave a little strangely.
- If you use
zoom
orzoomMaybe
to go fromState s
toState a
, the originalState s
will still be present in your effect stack. Writes to the zoomed part of thes
will be visible from inside theState a
, and vice-versa. zoomMany
cannot be sensibly implemented this way, so I have left it out.- Due to difficulties with higher-order effects, I have not yet found a way to implement the
magnify
functions.