selections-0.3.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) (Selection f b a') a a' Source #

Traversal over selected elements

selected = traverse

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

Traversal over unselected elements

unselected = inverting . selected

inverted :: Functor f => Traversal (Selection f b a) (Selection f b' a') (Selection f a b) (Selection f a' b') Source #

Traversal which inverts the current selection

This is provided as a Traversal to avoid adding a profunctors dependency. You can write the corresponding iso if you wish:

inverting = iso invertSelection invertSelection

unwrapped :: Traversal (Selection f b a) (Selection f b' a') (f (Either b a)) (f (Either b' a')) Source #

Traversal which exposes the underlying functor representation

This is provided as a Traversal to avoid adding a profunctors dependency. You can write the corresponding iso if you wish:

unwrapping = iso unwrapSelection wrapSelection