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

Data.ByteString.Strict.Lens

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

Traverse each Word8 in a ByteString.

This Traversal walks the ByteString in a tree-like fashion enable zippers to seek to locations in logarithmic time and accelerating 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 the ByteString in a tree-like fashion enable zippers to seek to locations in logarithmic time and accelerating many monoidal queries, but up to associativity (and constant factors) it is equivalent to the much slower:

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