HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulethese-1.2.1Haskell2010

Data.These.Combinators

This module provides

  • specialised versions of class members e.g. bitraverseThese

  • non-lens variants of Data.These.Lens things, e.g justHere

Contents
  1. Specialised combinators
  2. Bifunctor
  3. Bitraversable
  4. Associativity and commutativity
  5. Other operations
  6. preview
  7. toListOf
  8. is / has
  9. over / map
Synopsis
  • Packagethese-1.2.1
  • Exports25
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCombinators.hs

Specialised combinators

Bifunctor

Bitraversable

Associativity and commutativity

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
valuejustHere :: These a b -> Maybe a
Example1 expression
justHere (This 'x')Just 'x'
Example1 expression
justHere (That 'y')Nothing
Example1 expression
justHere (These 'x' 'y')Just 'x'
valuejustThere :: These a b -> Maybe b
Example1 expression
justThere (This 'x')Nothing
Example1 expression
justThere (That 'y')Just 'y'
Example1 expression
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)

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

over / map