| Copyright | (c) Matthew Mosior 2022 |
|---|---|
| License | BSD-style |
| Maintainer | mattm.github@gmail.com |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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
- bytestringToBWTToRLEB :: ByteString -> RLEB
- bytestringToBWTToRLET :: ByteString -> RLET
- textToBWTToRLEB :: Text -> RLEB
- textToBWTToRLET :: Text -> RLET
- textBWTToRLEB :: TextBWT -> RLEB
- bytestringBWTToRLEB :: BWT Word8 -> RLEB
- textBWTToRLET :: TextBWT -> RLET
- bytestringBWTToRLET :: BWT Word8 -> RLET
- textToRLEB :: Seq (Maybe Text) -> RLEB
- bytestringToRLEB :: Seq (Maybe ByteString) -> RLEB
- textToRLET :: Seq (Maybe Text) -> RLET
- bytestringToRLET :: Seq (Maybe ByteString) -> RLET
- bytestringFromBWTFromRLEB :: RLEB -> ByteString
- bytestringFromBWTFromRLET :: RLET -> ByteString
- textFromBWTFromRLEB :: RLEB -> Text
- textFromBWTFromRLET :: RLET -> Text
- textBWTFromRLET :: RLET -> BWT Text
- bytestringBWTFromRLET :: RLET -> BWT ByteString
- textBWTFromRLEB :: RLEB -> BWT Text
- bytestringBWTFromRLEB :: RLEB -> BWT ByteString
- textFromRLEB :: RLEB -> Seq (Maybe Text)
- bytestringFromRLEB :: RLEB -> Seq (Maybe ByteString)
- textFromRLET :: RLET -> Seq (Maybe Text)
- bytestringFromRLET :: RLET -> Seq (Maybe ByteString)
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 #
textToBWTToRLET :: Text -> RLET Source #
textBWTToRLEB :: TextBWT -> RLEB Source #
textBWTToRLET :: TextBWT -> RLET Source #
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 #
textFromBWTFromRLET :: RLET -> Text Source #
bytestringBWTFromRLET :: RLET -> BWT ByteString Source #
Takes a RLET and returns
the BWT of ByteStrings.
bytestringBWTFromRLEB :: RLEB -> BWT ByteString Source #
Take a RLEB and returns
the BWT of ByteStrings.
bytestringFromRLEB :: RLEB -> Seq (Maybe ByteString) Source #
Takes a RLEB and returns
the original Seq of ByteStrings.
bytestringFromRLET :: RLET -> Seq (Maybe ByteString) Source #
Takes a RLET and returns
the original Seq of ByteStrings.