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

Modulerio-0.1.22.0Haskell2010

RIO.ByteString.Partial

Strict ByteString partial functions. Import as:

import qualified RIO.ByteString.Partial as B'
  • 10 values
  • Packagerio-0.1.22.0
  • Exports10
  • LanguageHaskell2010
  • LicenceMIT
  • SourcePartial.hs

Basic interface

4 declarations
valuehead :: HasCallStack => ByteString -> Word8
#

O(1) Extract the first element of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString.

This is a partial function, consider using uncons instead.

valuelast :: HasCallStack => ByteString -> Word8
#

O(1) Extract the last element of a ByteString, which must be finite and non-empty. An exception will be thrown in the case of an empty ByteString.

This is a partial function, consider using unsnoc instead.

O(1) Extract the elements after the head of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString.

This is a partial function, consider using uncons instead.

Reducing ByteStrings (folds)

4 declarations

Special folds

2 declarations