HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulelens-5.3.6Haskell2010

Control.Lens.Each

  • 1 class
  • Packagelens-5.3.6
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceEach.hs

Each

1 declaration
classclass Each s t a b | s -> a, t -> b, s b -> t, t a -> s where
#

Extract each element of a (potentially monomorphic) container.

Notably, when applied to a tuple, this generalizes both to arbitrary homogeneous tuples.

Example1 expression
(1,2,3) & each *~ 10(10,20,30)

It can also be used on monomorphic containers like Text or ByteString.

Example1 expression
over each Char.toUpper ("hello"^.Text.packed)"HELLO"
Example1 expression
("hello","world") & each.each %~ Char.toUpper("HELLO","WORLD")

Methods

Instances35Each, …