I'd like to compose two traversals and then traverse the composition with something that also depends on the "middle" layer.
I think that would mean making an IndexedTraversal from the two Traversals:
rememberMidpoint :: Traversal' s a -> Traversal' a b -> IndexedTraversal' a s b
Maybe the question can be simplified further to
remember :: Traversal' s a -> IndexedTraversal' s a a
or
remember :: Traversal' s a -> IndexedTraversal' a s a
?
So my questions are:
- Am I correct in wanting to use
IndexedTraversalfor this? - If yes, how would I implement either
rememberMidpoint, or one of the tworememberfunctions + a way of composing their result with a non-indexedTraversal?