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

Moduleoptics-extra-0.4.2.1Haskell2010

Data.ByteString.Strict.Optics

  • 6 values

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, 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 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 % traversed
Example1 expression
anyOf chars (== 'h') $ Char8.pack "hello"True