Portability | portable |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Infered |
Lenses for working with sums
- traverseLeft :: Traversal (Either a c) (Either b c) a b
- traverseRight :: Traversal (Either c a) (Either c b) a b
Documentation
traverseLeft :: Traversal (Either a c) (Either b c) a bSource
A traversal for tweaking the left-hand value in 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 in 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)