text-compression-0.1.0.8: A text compression library.
Copyright(c) Matthew Mosior 2022
LicenseBSD-style
Maintainermattm.github@gmail.com
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.RLE.Internal

Description

WARNING

This module is considered internal.

The Package Versioning Policy does not apply.

The contents of this module may change in any way whatsoever and without any warning between minor versions of this package.

Authors importing this library are expected to track development closely.

All credit goes to the author(s)/maintainer(s) of the containers library for the above warning text.

Description

Various data structures and custom data types to describe the Run-length encoding (RLE) and the Inverse RLE implementations, namely vecToRLEB, vecToRLET, vecFromRLEB, and vecFromRLET.

The RLE implementations rely heavily upon Vector provided by the vector library, STRef and associated functions in the stref library, and runST in the Control.Monad.ST library.

Synopsis

Documentation

newtype RLEB Source #

Basic RLE (ByteString) data type.

Constructors

RLEB (Vector (Maybe ByteString)) 

Instances

Instances details
Generic RLEB Source # 
Instance details

Defined in Data.RLE.Internal

Associated Types

type Rep RLEB :: Type -> Type #

Methods

from :: RLEB -> Rep RLEB x #

to :: Rep RLEB x -> RLEB #

Read RLEB Source # 
Instance details

Defined in Data.RLE.Internal

Show RLEB Source # 
Instance details

Defined in Data.RLE.Internal

Methods

showsPrec :: Int -> RLEB -> ShowS #

show :: RLEB -> String #

showList :: [RLEB] -> ShowS #

Eq RLEB Source # 
Instance details

Defined in Data.RLE.Internal

Methods

(==) :: RLEB -> RLEB -> Bool #

(/=) :: RLEB -> RLEB -> Bool #

Ord RLEB Source # 
Instance details

Defined in Data.RLE.Internal

Methods

compare :: RLEB -> RLEB -> Ordering #

(<) :: RLEB -> RLEB -> Bool #

(<=) :: RLEB -> RLEB -> Bool #

(>) :: RLEB -> RLEB -> Bool #

(>=) :: RLEB -> RLEB -> Bool #

max :: RLEB -> RLEB -> RLEB #

min :: RLEB -> RLEB -> RLEB #

type Rep RLEB Source # 
Instance details

Defined in Data.RLE.Internal

type Rep RLEB = D1 ('MetaData "RLEB" "Data.RLE.Internal" "text-compression-0.1.0.8-70lkJCzZpdjEuFzWx0Few9" 'True) (C1 ('MetaCons "RLEB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector (Maybe ByteString)))))

newtype RLET Source #

Basic RLE (Text) data type.

Constructors

RLET (Vector (Maybe Text)) 

Instances

Instances details
Generic RLET Source # 
Instance details

Defined in Data.RLE.Internal

Associated Types

type Rep RLET :: Type -> Type #

Methods

from :: RLET -> Rep RLET x #

to :: Rep RLET x -> RLET #

Read RLET Source # 
Instance details

Defined in Data.RLE.Internal

Show RLET Source # 
Instance details

Defined in Data.RLE.Internal

Methods

showsPrec :: Int -> RLET -> ShowS #

show :: RLET -> String #

showList :: [RLET] -> ShowS #

Eq RLET Source # 
Instance details

Defined in Data.RLE.Internal

Methods

(==) :: RLET -> RLET -> Bool #

(/=) :: RLET -> RLET -> Bool #

Ord RLET Source # 
Instance details

Defined in Data.RLE.Internal

Methods

compare :: RLET -> RLET -> Ordering #

(<) :: RLET -> RLET -> Bool #

(<=) :: RLET -> RLET -> Bool #

(>) :: RLET -> RLET -> Bool #

(>=) :: RLET -> RLET -> Bool #

max :: RLET -> RLET -> RLET #

min :: RLET -> RLET -> RLET #

type Rep RLET Source # 
Instance details

Defined in Data.RLE.Internal

type Rep RLET = D1 ('MetaData "RLET" "Data.RLE.Internal" "text-compression-0.1.0.8-70lkJCzZpdjEuFzWx0Few9" 'True) (C1 ('MetaCons "RLET" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector (Maybe Text)))))

type RLEVecB = Vector (Maybe ByteString) Source #

Abstract RLEVecB type utilizing a sequence.

type STRLEVecB s a = STRef s RLEVecB Source #

Abstract data type representing a RLEVecB in the (strict) ST monad.

pushSTRLEVecB :: STRLEVecB s (Maybe ByteString) -> Maybe ByteString -> ST s () Source #

State function to push RLEVecB data into stack.

emptySTRLEVecB :: ST s (STRLEVecB s a) Source #

State function to create empty STRLEVecB type.

type STRLETempB s a = STRef s (Maybe ByteString) Source #

Abstract STRLETempB and associated state type.

updateSTRLETempB :: STRLETempB s (Maybe ByteString) -> Maybe ByteString -> ST s () Source #

State function to update STRLETempB.

emptySTRLETempB :: ST s (STRLETempB s a) Source #

State function to create empty STRLETempB type.

type STRLECounterB s a = STRef s Int Source #

Abstract STRLECounterB state type.

updateSTRLECounterB :: STRLECounterB s Int -> Int -> ST s () Source #

State function to update STRLECounterB.

emptySTRLECounterB :: ST s (STRLECounterB s Int) Source #

State function to create empty STRLECounterB type.

vecToRLEB :: RLEVecB -> ST s RLEVecB Source #

Strict state monad function.

type RLEVecT = Vector (Maybe Text) Source #

Abstract RLEVecT type utilizing a sequence.

type STRLEVecT s a = STRef s RLEVecT Source #

Abstract data type representing a RLEVecT in the (strict) ST monad.

pushSTRLEVecT :: STRLEVecT s (Maybe Text) -> Maybe Text -> ST s () Source #

State function to push RLEVecT data into stack.

emptySTRLEVecT :: ST s (STRLEVecT s a) Source #

State function to create empty STRLEVecT type.

type STRLETempT s a = STRef s (Maybe Text) Source #

Abstract STRLETempT state type.

updateSTRLETempT :: STRLETempT s (Maybe Text) -> Maybe Text -> ST s () Source #

State function to update STRLETempT.

emptySTRLETempT :: ST s (STRLETempT s a) Source #

State function to create empty STRLETempT type.

type STRLECounterT s a = STRef s Int Source #

Abstract STRLECounterT and associated state type.

updateSTRLECounterT :: STRLECounterT s Int -> Int -> ST s () Source #

State function to update STRLECounterT.

emptySTRLECounterT :: ST s (STRLECounterT s Int) Source #

State function to create empty STRLECounterT type.

vecToRLET :: RLEVecT -> ST s RLEVecT Source #

Strict state monad function.

unconsb2 :: Vector a -> Maybe (a, Vector a, Maybe (Vector a)) Source #

Vector auxilary function to pattern match on first two elements of a vector.

type FRLEVecB = Vector (Maybe ByteString) Source #

Abstract FRLEVecB type utilizing a sequence.

type FSTRLEVecB s a = STRef s FRLEVecB Source #

Abstract data type representing a FRLEVecB in the (strict) ST monad.

pushFSTRLEVecB :: FSTRLEVecB s (Maybe ByteString) -> Maybe ByteString -> ST s () Source #

State function to push FRLEVecB data into stack.

emptyFSTRLEVecB :: ST s (FSTRLEVecB s a) Source #

State function to create empty FSTRLEVecB type.

vecFromRLEB :: RLEB -> ST s FRLEVecB Source #

Strict state monad function.

unconst2 :: Vector a -> Maybe (a, Vector a, Maybe (Vector a)) Source #

Vector auxilary function to pattern match on first two elements of a vector.

type FRLEVecT = Vector (Maybe Text) Source #

Abstract FRLEVecT type utilizing a sequence.

type FSTRLEVecT s a = STRef s FRLEVecT Source #

Abstract data type representing a FRLEVecT in the (strict) ST monad.

pushFSTRLEVecT :: FSTRLEVecT s (Maybe Text) -> Maybe Text -> ST s () Source #

State function to push FSTRLEVecT data into stack.

emptyFSTRLEVecT :: ST s (FSTRLEVecT s a) Source #

State function to create empty FSTRLEVecT type.

vecFromRLET :: RLET -> ST s FRLEVecT Source #

Strict state monad function.