-- | Lifted lens composition.
--
-- For example, useful when specialized to lists:
--
-- > :: (f :-> [o])
-- > -> (o :-> [a])
-- > -> (f :-> [a])

lifted
  :: Monad m
  => (f -> g) :-> (m o -> m i)
  -> (o -> i) :-> (m a -> m b)
  -> (f -> g) :-> (m a -> m b)
lifted a b = lens (get b <=< get a) (modify a . liftM . modify b)
lifted
  :: Monad m
  => (f -> g) :-> (m o -> m i)
  -> (o -> i) :-> (m a -> m b)
  -> (f -> g) :-> (m a -> m b)
lifted a b = lens (get b <=< get a) (modify a . liftM . modify b)
lifted a b = lens (get b <=< get a) (modify a . liftM . modify b)