attoparsec-0.14.4: Fast combinator parsing for bytestrings and text
CopyrightBryan O'Sullivan 2007-2015
LicenseBSD3
Maintainerbos@serpentine.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Attoparsec.Text.Buffer

Description

An immutable buffer that supports cheap appends.

Synopsis

Documentation

data Buffer #

Instances

Instances details
Monoid Buffer # 
Instance details

Defined in Data.Attoparsec.Text.Buffer

Semigroup Buffer # 
Instance details

Defined in Data.Attoparsec.Text.Buffer

Methods

(<>) :: Buffer -> Buffer -> Buffer

sconcat :: NonEmpty Buffer -> Buffer

stimes :: Integral b => b -> Buffer -> Buffer

Show Buffer # 
Instance details

Defined in Data.Attoparsec.Text.Buffer

Methods

showsPrec :: Int -> Buffer -> ShowS

show :: Buffer -> String

showList :: [Buffer] -> ShowS

buffer :: Text -> Buffer #

The initial Buffer has no mutable zone, so we can avoid all copies in the (hopefully) common case of no further input being fed to us.

unbuffer :: Buffer -> Text #

unbufferAt :: Int -> Buffer -> Text #

length :: Buffer -> Int #

pappend :: Buffer -> Text -> Buffer #

iter :: Buffer -> Int -> Iter #

O(1) Iterate (unsafely) one step forwards through a UTF-8 array, returning the current character and the delta to add to give the next offset to iterate at.

iter_ :: Buffer -> Int -> Int #

O(1) Iterate one step through a UTF-8 array, returning the delta to add to give the next offset to iterate at.

substring :: Int -> Int -> Buffer -> Text #

lengthCodeUnits :: Text -> Int #

dropCodeUnits :: Int -> Buffer -> Text #