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 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
is still missing from base,
so this can't just be Traversable
(Either
c)traverse
traverseRight ::Applicative
f => (a -> f b) ->Either
c a -> f (Either
c a)