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

Moduleoptics-extra-0.4.2.1Haskell2010

Data.ByteString.Lazy.Optics

Lazy ByteString lenses.

  • 6 values

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, sets 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') $ Char8.pack "hello"True