HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulelens-5.3.5Haskell2010

Data.ByteString.Lazy.Lens

Lazy ByteString lenses.

  • 6 values
  • Packagelens-5.3.5
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceLens.hs

Traverse the individual bytes in a ByteString.

This Traversal walks each strict ByteString chunk in a tree-like fashion enable zippers to seek to locations more quickly and accelerate many monoidal queries, but up to associativity (and constant factors) it is equivalent to the much slower:

bytes ≡ unpackedBytes . traversed
Example1 expression
anyOf bytes (== 0x80) (Char8.pack "hello")False

Note that when just using this as a Setter, setting map can be more efficient.

Traverse the individual bytes in a ByteString as characters.

When writing back to the ByteString it is assumed that every Char lies between 'x00' and 'xff'.

This Traversal walks each strict ByteString chunk in a tree-like fashion enable zippers to seek to locations more quickly and accelerate many monoidal queries, but up to associativity (and constant factors) it is equivalent to:

chars = unpackedChars . traversed
Example1 expression
anyOf chars (== 'h') "hello"True