selections-0.2.0.0: Combinators for operating with selections over an underlying functor

Safe HaskellSafe
LanguageHaskell2010

Control.Lens.Selection

Synopsis

Documentation

selected :: Traversable f => Traversal' (Selection f b a) a Source #

Traversal over selected elements

selected = traverse

unselected :: Traversable f => Traversal' (Selection f b a) b Source #

Traversal over unselected elements

unselected = inverting . selected

inverting :: Functor f => Iso' (Selection f b a) (Selection f a b) Source #

Iso which inverts the current selection

inverting = iso invertSelection invertSelection

unwrapping :: Functor f => Iso' (Selection f b a) (f (Either b a)) Source #

Iso which exposes the underlying functor representation

unwrapping = iso unwrapSelection wrapSelection