| Safe Haskell | Trustworthy |
|---|---|
| Language | Haskell2010 |
Data.These.Combinators
Contents
Description
This module provides
- specialised versions of class members e.g.
bitraverseThese - non-lens variants of Data.These.Lens things, e.g
justHere
Synopsis
- bimapThese :: (a -> c) -> (b -> d) -> These a b -> These c d
- mapHere :: (a -> c) -> These a b -> These c b
- mapThere :: (b -> d) -> These a b -> These a d
- bitraverseThese :: Applicative f => (a -> f c) -> (b -> f d) -> These a b -> f (These c d)
- swapThese :: These a b -> These b a
- assocThese :: These (These a b) c -> These a (These b c)
- unassocThese :: These a (These b c) -> These (These a b) c
- justThis :: These a b -> Maybe a
- justThat :: These a b -> Maybe b
- justThese :: These a b -> Maybe (a, b)
- justHere :: These a b -> Maybe a
- justThere :: These a b -> Maybe b
- catThis :: [These a b] -> [a]
- catThat :: [These a b] -> [b]
- catThese :: [These a b] -> [(a, b)]
- catHere :: [These a b] -> [a]
- catThere :: [These a b] -> [b]
- isThis :: These a b -> Bool
- isThat :: These a b -> Bool
- isThese :: These a b -> Bool
- hasHere :: These a b -> Bool
- hasThere :: These a b -> Bool
- mapThis :: (a -> a) -> These a b -> These a b
- mapThat :: (b -> b) -> These a b -> These a b
- mapThese :: ((a, b) -> (a, b)) -> These a b -> These a b
Specialised combinators
Bifunctor
Bitraversable
bitraverseThese :: Applicative f => (a -> f c) -> (b -> f d) -> These a b -> f (These c d) Source #
Bitraversable bitraverse.
Associativity and commutativity
unassocThese :: These a (These b c) -> These (These a b) c Source #
These is associative. See assocThese.
Since: 0.8
Other operations
preview
justThis=preview_ThisjustThat=preview_ThatjustThese=preview_ThesejustHere=previewherejustThere=previewthere
justHere :: These a b -> Maybe a Source #
>>>justHere (This 'x')Just 'x'
>>>justHere (That 'y')Nothing
>>>justHere (These 'x' 'y')Just 'x'
justThere :: These a b -> Maybe b Source #
>>>justThere (This 'x')Nothing
>>>justThere (That 'y')Just 'y'
>>>justThere (These 'x' 'y')Just 'y'
toListOf
catThis=toListOf(folded._This)catThat=toListOf(folded._That)catThese=toListOf(folded._These)catHere=toListOf(folded.here)catThere=toListOf(folded.there)