% package:optics-core

Compose two optics of compatible flavours. Returns an optic of the appropriate supertype. If either or both optics are indexed, the composition preserves all the indices.
Shortcut for % _Just %. Useful for composing lenses of Maybe type.
Compose two indexed optics and drop indices of the left one. (If you want to compose a non-indexed and an indexed optic, you can just use (%).)
>>> itoListOf (ifolded %> ifolded) ["foo", "bar"]
[(0,'f'),(1,'o'),(2,'o'),(0,'b'),(1,'a'),(2,'r')]
Compose two optics of the same flavour. Normally you can simply use (%) instead, but this may be useful to help type inference if the type of one of the optics is otherwise under-constrained.
Flipped function application, specialised to optics and binding tightly. Useful for post-composing optics transformations:
>>> toListOf (ifolded %& ifiltered (\i s -> length s <= i)) ["", "a","abc"]
["","a"]
Infix version of over'.
Infix version of over.
Compose two indexed optics and drop indices of the right one. (If you want to compose an indexed and a non-indexed optic, you can just use (%).)
>>> itoListOf (ifolded <% ifolded) ["foo", "bar"]
[(0,'f'),(0,'o'),(0,'o'),(1,'b'),(1,'a'),(1,'r')]
Compose two indexed optics. Their indices are composed as a pair.
>>> itoListOf (ifolded <%> ifolded) ["foo", "bar"]
[((0,0),'f'),((0,1),'o'),((0,2),'o'),((1,0),'b'),((1,1),'a'),((1,2),'r')]