compact-string-0.3.1: Fast, packed and strict strings with Unicode support, based on bytestrings.

Portabilityuntested
Stabilityexperimental
Maintainertwanvl@gmail.com

Data.CompactString.Fusion

Description

Fusable loop functions, mirrors Data.ByteString.Fusion.

Synopsis

Documentation

loopAcc :: PairS acc arr -> accSource

loopArr :: PairS acc arr -> arrSource

Projection functions that are fusion friendly (as in, we determine when they are inlined)

data NoAcc Source

Data type for accumulators which can be ignored. The rewrite rules rely on the fact that no bottoms of this type are ever constructed; hence, we can assume (_ :: NoAcc) seq x = x.

Constructors

NoAcc 

foldEFL :: (acc -> Char -> acc) -> AccEFL accSource

mapAccumEFL :: (acc -> Char -> (acc, Char)) -> AccEFL accSource

Element function implementing a map and fold

mapIndexEFL :: (Int -> Char -> Char) -> AccEFL IntSource

Element function implementing a map with index

loopUp :: Encoding a => AccEFL acc -> acc -> CompactString a -> PairS acc (CompactString a)Source

loopUpC :: Encoding a => AccEFL acc -> acc -> CompactString a -> PairS acc (CompactString a)Source

like loopUp, but the size of the buffer can only become smaller

loopDown :: Encoding a => AccEFL acc -> acc -> CompactString a -> PairS acc (CompactString a)Source

loopUpFold :: Encoding a => FoldEFL acc -> acc -> CompactString a -> accSource

loopDownFold :: Encoding a => FoldEFL acc -> acc -> CompactString a -> accSource