lens-2.4: Lenses, Folds and Traversals

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Infered

Data.Either.Lens

Description

Lenses for working with sums

Synopsis

Documentation

traverseLeft :: Traversal (Either a c) (Either b c) a bSource

A traversal for tweaking the left-hand value of an Either:

traverseLeft :: Applicative f => (a -> f b) -> Either a c -> f (Either b c)

traverseRight :: Traversal (Either c a) (Either c b) a bSource

traverse the right-hand value of an Either:

traverseRight = traverse

Unfortunately the instance for Traversable (Either c) is still missing from base, so this can't just be traverse

traverseRight :: Applicative f => (a -> f b) -> Either c a -> f (Either c a)