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

Data.RLE

Description

Run-length encoding (RLE)

Users will get the most mileage by first compressing to a BWT on the initial ByteString or Text input before compressing to a RLEB or RLET.

To do this, users can use the bytestringToBWTToRLEB and bytestringToBWTToRLET functions, as well as the textToBWTToRLEB and textToBWTToRLET functions.

The base functions for ByteString, bytestringToRLEB and bytestringToRLET can be used to convert a Seq (Maybe ByteString) to a RLEB and RLET, respectively.

Likewise, the base functions for Text, textToRLEB and textToRLET can be used to convert a Seq (Maybe Text) to a RLEB and RLET respectively.

There are various other lower-level functions for interacting with the RLE implementation on ByteString and Text as well.

Data.RLE.Internal contains efficient and stateful implementations of the RLE and Inverse RLE algorithms.

Synopsis

To RLE functions

bytestringToBWTToRLEB :: ByteString -> RLEB Source #

Helper function for converting a ByteString to a RLEB via a BWT first.

bytestringToBWTToRLET :: ByteString -> RLET Source #

Helper function for converting a ByteString to a RLET via a BWT first.

textToBWTToRLEB :: Text -> RLEB Source #

Helper function for converting a Text to a RLEB via a BWT first.

textToBWTToRLET :: Text -> RLET Source #

Helper function for converting a Text to a RLET via a BWT first.

textBWTToRLEB :: TextBWT -> RLEB Source #

Take a BWT of Word8s and generate the Run-length encoding (RLEB).

bytestringBWTToRLEB :: BWT Word8 -> RLEB Source #

Take a BWT of Word8s and generate the Run-length encoding (RLEB).

textBWTToRLET :: TextBWT -> RLET Source #

Take a BWT of Word8s and generate the Run-length encoding (RLEB).

bytestringBWTToRLET :: BWT Word8 -> RLET Source #

Take a BWT of Word8s and generate the Run-length encoding (RLET).

textToRLEB :: Seq (Maybe Text) -> RLEB Source #

Takes a Text and returns the Run-length encoding (RLEB).

bytestringToRLEB :: Seq (Maybe ByteString) -> RLEB Source #

Takes a Seq of ByteStrings and returns the Run-length encoding (RLEB).

textToRLET :: Seq (Maybe Text) -> RLET Source #

Takes a Text and returns the Run-length encoding (RLE).

bytestringToRLET :: Seq (Maybe ByteString) -> RLET Source #

Takes a ByteString and returns the Run-length encoding (RLE).

From RLE functions

bytestringFromBWTFromRLEB :: RLEB -> ByteString Source #

Helper function for converting a BWTed RLEB back to the original ByteString.

bytestringFromBWTFromRLET :: RLET -> ByteString Source #

Helper function for converting a BWTed RLET back to the original ByteString.

textFromBWTFromRLEB :: RLEB -> Text Source #

Helper function for converting a BWTed RLEB back to the original Text.

textFromBWTFromRLET :: RLET -> Text Source #

Helper function for converting a BWTed RLET back to the original Text.

textBWTFromRLET :: RLET -> BWT Text Source #

Takes a RLET and returns the BWT of Texts.

bytestringBWTFromRLET :: RLET -> BWT ByteString Source #

Takes a RLET and returns the BWT of ByteStrings.

textBWTFromRLEB :: RLEB -> BWT Text Source #

Takes a RLEB and returns the BWT of Texts.

textFromRLEB :: RLEB -> Seq (Maybe Text) Source #

Takes a RLEB and returns the original Seq of Texts.

bytestringFromRLEB :: RLEB -> Seq (Maybe ByteString) Source #

Takes a RLEB and returns the original Seq of ByteStrings.

textFromRLET :: RLET -> Seq (Maybe Text) Source #

Takes a RLET and returns the original Seq of Texts.

bytestringFromRLET :: RLET -> Seq (Maybe ByteString) Source #

Takes a RLET and returns the original Seq of ByteStrings.