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

Data.ByteString.Lazy.Lens

Lazy ByteString lenses.

  • 6 values
  • Packagelens-5.3.6
  • 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