HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulebyteslice-0.2.15.0Haskell2010

Data.Bytes.Text.AsciiExt

This module contains functions which operate on supersets of Bytes containing ASCII-encoded text. That is, none of the functions here inspect bytes with a value greater than 127, and do not fail due to the presence of such bytes.

Contents
  1. Line-Oriented IO
  2. Standard Handles
  3. Predicates
  4. Filtering
  5. Splitting
  6. Fixed from Beginning
  7. Text Manipulation
Synopsis

Line-Oriented IO

valuehFoldLines :: Handle -> a -> (a -> Bytes -> IO a) -> IO a

Perform an action on each line of the input, threading state through the computation. If you do not need to keep a state, see hForLines_.

Lines are extracted with with hGetLine, which does not document its detection algorithm. As of writing (bytestring v0.11.1.0), lines are delimited by a single n character (UNIX-style, as all things should be).

valuehForLines_ :: Handle -> (Bytes -> IO a) -> IO ()

Perform an action on each line of the input, discarding results. To maintain a running state, see hFoldLines.

Lines are extracted with with hGetLine, which does not document its detection algorithm. As of writing (bytestring v0.11.1.0), lines are delimited by a single n character (UNIX-style, as all things should be).

Standard Handles

Predicates

Filtering

Splitting

Fixed from Beginning

Text Manipulation

O(n) Convert ASCII letters to lowercase. This adds 0x20 to bytes in the range [0x41,0x5A] (A-Z ⇒ a-z) and leaves all other bytes alone. Unconditionally copies the bytes.