Bifunctor bimap.
Modulethese-1.2.1Haskell2010
Data.These.Combinators
This module provides
specialised versions of class members e.g. bitraverseThese
non-lens variants of
Data.These.Lensthings, e.g justHere
Contents
Synopsis
- value bimapThese
- value mapHere
- value mapThere
- value bitraverseThese
- value swapThese
- value assocThese
- value unassocThese
- value justThis
- value justThat
- value justThese
- value justHere
- value justThere
- value catThis
- value catThat
- value catThese
- value catHere
- value catThere
- value isThis
- value isThat
- value isThese
- value hasHere
- value hasThere
- value mapThis
- value mapThat
- value mapThese
- Packagethese-1.2.1
- Exports25
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceCombinators.hs
Specialised combinators
Bifunctor
mapHere = Control.Lens.over heremapThere = Control.Lens.over thereBitraversable
Bitraversable bitraverse.
Associativity and commutativity
These is associative.
assocThese . unassocThese = id
unassocThese . assocThese = id
These is associative. See assocThese.
Other operations
preview
justThis = Control.Lens.preview _This
justThat = Control.Lens.preview _That
justThese = Control.Lens.preview _These
justHere = Control.Lens.preview here
justThere = Control.Lens.preview there
justHere (This 'x')Just 'x'
justHere (That 'y')Nothing
justHere (These 'x' 'y')Just 'x'
justThere (This 'x')Nothing
justThere (That 'y')Just 'y'
justThere (These 'x' 'y')Just 'y'
toListOf
catThis = Control.Lens.toListOf (Control.Lens.folded . _This)
catThat = Control.Lens.toListOf (Control.Lens.folded . _That)
catThese = Control.Lens.toListOf (Control.Lens.folded . _These)
catHere = Control.Lens.toListOf (Control.Lens.folded . here)
catThere = Control.Lens.toListOf (Control.Lens.folded . there)
Select all This constructors from a list.
Select all That constructors from a list.
Select all These constructors from a list.
is / has
isThis = Control.Lens.Extra.is _This
isThat = Control.Lens.Extra.is _That
isThese = Control.Lens.Extra.is _These
hasHere = Control.Lens.has here
hasThere = Control.Lens.has there