HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulelens-5.3.5Haskell2010

Control.Lens.Each

  • 1 class
  • Packagelens-5.3.5
  • 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, …