| Copyright | (c) Matthew Mosior 2022 |
|---|---|
| License | BSD-style |
| Maintainer | mattm.github@gmail.com |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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 seqToRLEB, seqToRLET, seqFromRLEB, and seqFromRLET.
The RLE implementations rely heavily upon Seq provided by the containers,
STRef and associated functions in the stref library,
and runST in the Control.Monad.ST library.
Synopsis
- newtype RLEB = RLEB (Seq (Maybe ByteString))
- newtype RLET = RLET (Seq (Maybe Text))
- type RLESeqB = Seq (Maybe ByteString)
- type STRLESeqB s a = STRef s RLESeqB
- pushSTRLESeqB :: STRLESeqB s (Maybe ByteString) -> Maybe ByteString -> ST s ()
- emptySTRLESeqB :: ST s (STRLESeqB s a)
- type STRLETempB s a = STRef s (Maybe ByteString)
- updateSTRLETempB :: STRLETempB s (Maybe ByteString) -> Maybe ByteString -> ST s ()
- emptySTRLETempB :: ST s (STRLETempB s a)
- type STRLECounterB s a = STRef s Int
- updateSTRLECounterB :: STRLECounterB s Int -> Int -> ST s ()
- emptySTRLECounterB :: ST s (STRLECounterB s Int)
- seqToRLEB :: RLESeqB -> ST s RLESeqB
- type RLESeqT = Seq (Maybe Text)
- type STRLESeqT s a = STRef s RLESeqT
- pushSTRLESeqT :: STRLESeqT s (Maybe Text) -> Maybe Text -> ST s ()
- emptySTRLESeqT :: ST s (STRLESeqT s a)
- type STRLETempT s a = STRef s (Maybe Text)
- updateSTRLETempT :: STRLETempT s (Maybe Text) -> Maybe Text -> ST s ()
- emptySTRLETempT :: ST s (STRLETempT s a)
- type STRLECounterT s a = STRef s Int
- updateSTRLECounterT :: STRLECounterT s Int -> Int -> ST s ()
- emptySTRLECounterT :: ST s (STRLECounterT s Int)
- seqToRLET :: RLESeqT -> ST s RLESeqT
- type FRLESeqB = Seq (Maybe ByteString)
- type FSTRLESeqB s a = STRef s FRLESeqB
- pushFSTRLESeqB :: FSTRLESeqB s (Maybe ByteString) -> Maybe ByteString -> ST s ()
- emptyFSTRLESeqB :: ST s (FSTRLESeqB s a)
- seqFromRLEB :: RLEB -> ST s FRLESeqB
- type FRLESeqT = Seq (Maybe Text)
- type FSTRLESeqT s a = STRef s FRLESeqT
- pushFSTRLESeqT :: FSTRLESeqT s (Maybe Text) -> Maybe Text -> ST s ()
- emptyFSTRLESeqT :: ST s (FSTRLESeqT s a)
- seqFromRLET :: RLET -> ST s FRLESeqT
Base RLE types
Basic RLE (ByteString) data type.
Constructors
| RLEB (Seq (Maybe ByteString)) |
Basic RLE (Text) data type.
To RLE (ByteString) functions
type STRLESeqB s a = STRef s RLESeqB Source #
Abstract data type representing a RLESeqB in the (strict) ST monad.
pushSTRLESeqB :: STRLESeqB s (Maybe ByteString) -> Maybe ByteString -> ST s () Source #
State function to push RLESeqB data into stack.
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.
To RLE (Text) functions
type STRLESeqT s a = STRef s RLESeqT Source #
Abstract data type representing a RLESeqT in the (strict) ST monad.
pushSTRLESeqT :: STRLESeqT s (Maybe Text) -> Maybe Text -> ST s () Source #
State function to push RLESeqT data into stack.
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.
From RLE (ByteString) functions
type FSTRLESeqB s a = STRef s FRLESeqB Source #
Abstract data type representing a FRLESeqB in the (strict) ST monad.
pushFSTRLESeqB :: FSTRLESeqB s (Maybe ByteString) -> Maybe ByteString -> ST s () Source #
State function to push FRLESeqB data into stack.
emptyFSTRLESeqB :: ST s (FSTRLESeqB s a) Source #
State function to create empty FSTRLESeqB type.
From RLE (Text) functions
type FSTRLESeqT s a = STRef s FRLESeqT Source #
Abstract data type representing a FRLESeqT in the (strict) ST monad.
pushFSTRLESeqT :: FSTRLESeqT s (Maybe Text) -> Maybe Text -> ST s () Source #
State function to push FSTRLESeqT data into stack.
emptyFSTRLESeqT :: ST s (FSTRLESeqT s a) Source #
State function to create empty FSTRLESeqT type.