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

Modulebyteslice-0.2.13.2Haskell2010

Data.Bytes.Text.Ascii

This module treats Bytes data as holding ASCII text. Providing bytes outside the ASCII range (U+0000 -- U+007F) may cause a failure or unspecified results, but such bytes will never be inspected.

For functions that can operate on ASCII-compatible encodings, see Data.Bytes.Text.AsciiExt.

  • 6 values
valuefromString :: String -> Bytes
#

Convert a String consisting of only characters in the ASCII block to a byte sequence. Any character with a codepoint above U+007F is replaced by U+0000.

valuedecodeDecWord :: Bytes -> Maybe Word
#

Decode machine-sized word from decimal representation. Returns Nothing on overflow. Allows any number of leading zeros. Trailing non-digit bytes cause Nothing to be returned.

valuetoText :: Bytes -> Maybe Text
#

Interpret byte sequence as ASCII codepoints. Only available when building with text-2.0 and newer. Returns Nothing if any of the bytes are outside of the range 0x00-0x7F