-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A text compression library. -- -- This package contains efficient implementations of various text -- compression algorithms. @package text-compression @version 0.1.0.13 -- |

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 -- Burrows-Wheeler Transform (BWT) and the Inverse BWT. -- -- The implementation of the BWT relies upon Seq provided by the -- containers. -- -- The internal BWTMatrix data type relies upon the Seq as -- well. module Data.BWT.Internal -- | Basic suffix data type. Used to describe the core data inside of the -- SuffixArray data type. data Suffix a Suffix :: Int -> Int -> Maybe (Seq a) -> Suffix a [suffixindex] :: Suffix a -> Int [suffixstartpos] :: Suffix a -> Int [suffix] :: Suffix a -> Maybe (Seq a) -- | The SuffixArray data type. Uses Seq internally. type SuffixArray a = Seq (Suffix a) -- | The BWT data type. Uses Seq internally. newtype BWT a BWT :: Seq (Maybe a) -> BWT a -- | The BWTMatrix data type. Uses a Array internally. newtype BWTMatrix a BWTMatrix :: Seq (Seq (Maybe a)) -> BWTMatrix a -- | Computes the Burrows-Wheeler Transform (BWT) using the suffix array -- and the original string (represented as a Seq for performance). saToBWT :: SuffixArray a -> Seq a -> Seq (Maybe a) -- | Computes the corresponding SuffixArray of a given string. -- Please see suffix array for more information. createSuffixArray :: Ord a => Seq a -> SuffixArray a -- | Hierarchical sorting scheme that compares fst first then snd. -- Necessary for the setting up the BWT in order to correctly invert it -- using the Magic algorithm. sortTB :: (Ord a1, Ord a2) => (a1, a2) -> (a1, a2) -> Ordering -- | Abstract BWTSeq type utilizing a Seq. type BWTSeq a = Seq a -- | Abstract data type representing a BWTSeq in the (strict) ST monad. type STBWTSeq s a = STRef s (BWTSeq a) -- | State function to push BWTString data into stack. pushSTBWTSeq :: STBWTSeq s a -> a -> ST s () -- | State function to create empty STBWTString type. emptySTBWTSeq :: ST s (STBWTSeq s a) -- | Abstract BWTCounter and associated state type. type STBWTCounter s a = STRef s Int -- | State function to update BWTCounter. updateSTBWTCounter :: STBWTCounter s Int -> Int -> ST s () -- | State function to create empty STBWTCounter type. emptySTBWTCounter :: ST s (STBWTCounter s Int) -- | Magic Inverse BWT function. magicInverseBWT :: Seq (Maybe a, Int) -> ST s (BWTSeq a) -- | Simple yet efficient implementation of converting a given string into -- a BWT Matrix (the BWTMatrix type is a Seq (Maybe a). createBWTMatrix :: Ord a => [a] -> BWTMatrix a instance GHC.Generics.Generic (Data.BWT.Internal.Suffix a) instance GHC.Read.Read a => GHC.Read.Read (Data.BWT.Internal.Suffix a) instance GHC.Show.Show a => GHC.Show.Show (Data.BWT.Internal.Suffix a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.BWT.Internal.Suffix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.BWT.Internal.Suffix a) instance GHC.Generics.Generic (Data.BWT.Internal.BWT a) instance GHC.Read.Read a => GHC.Read.Read (Data.BWT.Internal.BWT a) instance GHC.Show.Show a => GHC.Show.Show (Data.BWT.Internal.BWT a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.BWT.Internal.BWT a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.BWT.Internal.BWT a) instance GHC.Generics.Generic (Data.BWT.Internal.BWTMatrix a) instance GHC.Read.Read a => GHC.Read.Read (Data.BWT.Internal.BWTMatrix a) instance GHC.Show.Show a => GHC.Show.Show (Data.BWT.Internal.BWTMatrix a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.BWT.Internal.BWTMatrix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.BWT.Internal.BWTMatrix a) -- |

Burrows-Wheeler Transform (BWT)

-- -- The two functions that most users will utilize are toBWT and -- fromBWT. There are auxilary function(s) inside of -- Data.BWT.Internal. -- -- The helper functions for ByteString, bytestringToBWT, -- bytestringFromWord8BWT, bytestringFromByteStringBWT and -- Text, textToBWT and textFromBWT should help for common -- use cases. -- -- Data.BWT.Internal also has the function -- createBWTMatrix, which can be useful as well, although not used -- by either toBWT or fromBWT. module Data.BWT -- | Takes a String and returns the Burrows-Wheeler Transform (BWT). -- Implemented via a SuffixArray. toBWT :: Ord a => [a] -> BWT a -- | Helper function for converting a ByteString to a BWT -- Word8. bytestringToBWT :: ByteString -> BWT Word8 -- | A newtype to ensure you only uncompress a BWT created from -- textToBWT, since [Word8] -> Text is partial. newtype TextBWT TextBWT :: BWT Word8 -> TextBWT -- | Helper function for converting Text to a TextBWT. textToBWT :: Text -> TextBWT -- | Takes a BWT data type (please see Data.BWT.Internal) -- and inverts it back to the original string. -- -- This function utilizes the state monad (strict) in order to implement -- the Magic Inverse BWT algorithm by backtracking indices -- starting with the (Nothing,_) entry. fromBWT :: Ord a => BWT a -> [a] -- | Helper function for converting a BWT of Word8s to a -- ByteString. bytestringFromWord8BWT :: BWT Word8 -> ByteString -- | Helper function for converting a BWT ByteStrings to a -- ByteString. bytestringFromByteStringBWT :: BWT ByteString -> ByteString -- | Helper function for converting TextBWT to a Text textFromBWT :: TextBWT -> Text instance GHC.Generics.Generic Data.BWT.TextBWT instance GHC.Read.Read Data.BWT.TextBWT instance GHC.Show.Show Data.BWT.TextBWT instance GHC.Classes.Ord Data.BWT.TextBWT instance GHC.Classes.Eq Data.BWT.TextBWT -- |

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 -- Move-to-front transform (MTF) and the Inverse MTF implementations, -- namely seqToMTFB, seqToMTFT, seqFromMTFB, and -- seqFromMTFT. -- -- The MTF 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. module Data.MTF.Internal -- | Basic MTF (ByteString) data type. newtype MTFB MTFB :: (Seq Int, Seq (Maybe ByteString)) -> MTFB -- | Basic MTF (Text) data type. newtype MTFT MTFT :: (Seq Int, Seq (Maybe Text)) -> MTFT -- | Useful to acquire the unique elements that make up a Seq. -- Credit to @DavidFletcher. See this stackoverflow post. nubSeq' :: Ord a => Seq (Maybe a) -> Seq (Maybe a) -- | Abstract PBMTFSeqB type utilizing a Seq type PBMTFSeqB = Seq (Maybe ByteString) -- | Abstract MTFLSSeqB type utilizing a Seq. type MTFLSSeqB = (Seq Int, Seq (Maybe ByteString)) -- | Abstract data type representing a MTFLSSeqB in the (strict) ST -- monad. type STMTFLSSeqB s a = STRef s MTFLSSeqB -- | Abstract data type to initialize a STMTFLSSeqB using the -- initial list. initializeSTMTFLSSeqB :: STMTFLSSeqB s (Seq Int, Seq (Maybe ByteString)) -> Seq (Maybe ByteString) -> ST s () -- | State function to update MTFLSSeqB with each step of the MTF. updateSTMTFLSSeqB :: STMTFLSSeqB s (Seq Int, Seq (Maybe ByteString)) -> Int -> ST s () -- | State function to create empty STMTFLSSeqB type. emptySTMTFLSSeqB :: ST s (STMTFLSSeqB s a) -- | Abstract STMTFILB and associated state type. type STMTFILB s a = STRef s (Seq (Maybe ByteString)) -- | State function to load list into STMTFILB. loadSTMTFILB :: STMTFILB s (Maybe ByteString) -> Seq (Maybe ByteString) -> ST s () -- | State function to create empty STMTFILB type. emptySTMTFILB :: ST s (STMTFILB s a) -- | Abstract STMTFCounterB and associated state type. type STMTFCounterB s a = STRef s Int -- | State function to update STMTFCounterB. updateSTMTFCounterB :: STMTFCounterB s Int -> Int -> ST s () -- | State function to create empty STMTFCounterB type. emptySTMTFCounterB :: ST s (STMTFCounterB s Int) -- | Strict state monad function. seqToMTFB :: PBMTFSeqB -> ST s MTFLSSeqB -- | Abstract PTMTFSeqT type utilizing a Seq type PTMTFSeqT = Seq (Maybe Text) -- | Abstract MTFLSSeqT type utilizing a Seq. type MTFLSSeqT = (Seq Int, Seq (Maybe Text)) -- | Abstract data type representing a MTFLSSeqT in the (strict) ST -- monad. type STMTFLSSeqT s a = STRef s MTFLSSeqT -- | Abstract data type to initialize a STMTFLSSeqT using the -- initial list. initializeSTMTFLSSeqT :: STMTFLSSeqT s (Seq Int, Seq (Maybe Text)) -> Seq (Maybe Text) -> ST s () -- | State function to update STMTFLSSeqT with each step of the MTF. updateSTMTFLSSeqT :: STMTFLSSeqT s (Seq Int, Seq (Maybe Text)) -> Int -> ST s () -- | State function to create empty STMTFLSSeqT type. emptySTMTFLSSeqT :: ST s (STMTFLSSeqT s a) -- | Abstract STMTFILT and associated state type. type STMTFILT s a = STRef s (Seq (Maybe Text)) -- | State function to load list into STMTFILT. loadSTMTFILT :: STMTFILT s (Maybe Text) -> Seq (Maybe Text) -> ST s () -- | State function to create empty STMTFILT type. emptySTMTFILT :: ST s (STMTFILT s a) -- | Abstract STMTFCounterT and associated state type. type STMTFCounterT s a = STRef s Int -- | State function to update STMTFCounterT. updateSTMTFCounterT :: STMTFCounterT s Int -> Int -> ST s () -- | State function to create empty STMTFCounterT type. emptySTMTFCounterT :: ST s (STMTFCounterT s Int) -- | Strict state monad function. seqToMTFT :: PTMTFSeqT -> ST s MTFLSSeqT -- | Abstract FMTFSeqB type utilizing a Seq. type FMTFSeqB = Seq (Maybe ByteString) -- | Abstract data type representing a FMTFSeqB in the (strict) ST -- monad. type FSTMTFSeqB s a = STRef s FMTFSeqB -- | State function to update FSTMTFSeqB with each step of the -- inverse MTF. updateFSTMTFSeqB :: FSTMTFSeqB s (Maybe ByteString) -> Maybe ByteString -> ST s () -- | State function to create empty FSTMTFSeqB type. emptyFSTMTFSeqB :: ST s (FSTMTFSeqB s a) -- | Abstract FSTMTFILB and associated state type. type FSTMTFILB s a = STRef s (Seq (Maybe ByteString)) -- | State function to load list into FSTMTFILB. loadFSTMTFILB :: FSTMTFILB s (Maybe ByteString) -> Seq (Maybe ByteString) -> ST s () -- | State function to update FSTMTFILB. updateFSTMTFILB :: FSTMTFILB s (Maybe ByteString) -> Int -> ST s () -- | State function to create empty FSTMTFILB type. emptyFSTMTFILB :: ST s (FSTMTFILB s a) -- | Strict state monad function. seqFromMTFB :: MTFB -> ST s FMTFSeqB -- | Abstract FMTFSeqT type utilizing a Seq. type FMTFSeqT = Seq (Maybe Text) -- | Abstract data type representing a FMTFSeqT in the (strict) ST -- monad. type FSTMTFSeqT s a = STRef s FMTFSeqT -- | State function to update FSTMTFSeqT with each step of the -- inverse MTF. updateFSTMTFSeqT :: FSTMTFSeqT s (Maybe Text) -> Maybe Text -> ST s () -- | State function to create empty FSTMTFSeqT type. emptyFSTMTFSeqT :: ST s (FSTMTFSeqT s a) -- | Abstract FSTMTFILT and associated state type. type FSTMTFILT s a = STRef s (Seq (Maybe Text)) -- | State function to load list into FSTMTFILT. loadFSTMTFILT :: FSTMTFILT s (Maybe Text) -> Seq (Maybe Text) -> ST s () -- | State function to update FSTMTFILT. updateFSTMTFILT :: FSTMTFILT s (Maybe Text) -> Int -> ST s () -- | State function to create empty FSTMTFILT type. emptyFSTMTFILT :: ST s (FSTMTFILT s a) -- | Strict state monad function. seqFromMTFT :: MTFT -> ST s FMTFSeqT instance GHC.Generics.Generic Data.MTF.Internal.MTFB instance GHC.Read.Read Data.MTF.Internal.MTFB instance GHC.Show.Show Data.MTF.Internal.MTFB instance GHC.Classes.Ord Data.MTF.Internal.MTFB instance GHC.Classes.Eq Data.MTF.Internal.MTFB instance GHC.Generics.Generic Data.MTF.Internal.MTFT instance GHC.Read.Read Data.MTF.Internal.MTFT instance GHC.Show.Show Data.MTF.Internal.MTFT instance GHC.Classes.Ord Data.MTF.Internal.MTFT instance GHC.Classes.Eq Data.MTF.Internal.MTFT -- |

Move-to-front transform (MTF)

-- -- Users will get the most mileage by first compressing to a BWT -- on the initial ByteString or Text input before -- compressing to a MTFB or MTFT. -- -- To do this, users can use the bytestringToBWTToMTFB and -- bytestringToBWTToMTFT functions, as well as the -- textToBWTToMTFB and textToBWTToMTFT functions. -- -- The base functions for ByteString, bytestringToMTFB and -- bytestringToMTFT can be used to convert a Seq -- (Maybe ByteString) to a MTFB and MTFT, -- respectively. -- -- Likewise, the base functions for Text, textToMTFB and -- textToMTFT can be used to convert a Seq (Maybe -- Text) to a MTFB and MTFT respectively. -- -- There are various other lower-level functions for interacting with the -- MTF implementation on ByteString and Text as well. -- -- Data.MTF.Internal contains efficient and stateful -- implementations of the MTF and Inverse MTF algorithms. module Data.MTF -- | Helper function for converting a ByteString to a MTFB -- via a BWT first. bytestringToBWTToMTFB :: ByteString -> MTFB -- | Helper function for converting a ByteString to a MTFT -- via a BWT first. bytestringToBWTToMTFT :: ByteString -> MTFT -- | Helper function for converting a Text to a MTFB via a -- BWT first. textToBWTToMTFB :: Text -> MTFB -- | Helper function for converting a Text to a MTFT via a -- BWT first. textToBWTToMTFT :: Text -> MTFT -- | Take a BWT of Word8s and generate the Move-to-front -- transform (MTFB). textBWTToMTFB :: TextBWT -> MTFB -- | Take a BWT of Word8s and generate the Move-to-front -- transform (MTFB). bytestringBWTToMTFB :: BWT Word8 -> MTFB -- | Take a BWT of Word8s and generate the Move-to-front -- transform (MTFB). textBWTToMTFT :: TextBWT -> MTFT -- | Take a BWT of Word8s and generate the Move-to-front -- transform (MTFT). bytestringBWTToMTFT :: BWT Word8 -> MTFT -- | Takes a Text and returns the Move-to-front transform -- (MTFB). textToMTFB :: Seq (Maybe Text) -> MTFB -- | Takes a Seq of ByteStrings and returns the Move-to-front -- transform (MTFB). bytestringToMTFB :: Seq (Maybe ByteString) -> MTFB -- | Takes a Text and returns the Move-to-front transform -- (MTFT). textToMTFT :: Seq (Maybe Text) -> MTFT -- | Takes a ByteString and returns the Move-to-front transform -- (MTFT). bytestringToMTFT :: Seq (Maybe ByteString) -> MTFT -- | Helper function for converting a BWTed MTFB back to the -- original ByteString. bytestringFromBWTFromMTFB :: MTFB -> ByteString -- | Helper function for converting a BWTed MTFT back to the -- original ByteString. bytestringFromBWTFromMTFT :: MTFT -> ByteString -- | Helper function for converting a BWTed MTFB back to the -- original Text. textFromBWTFromMTFB :: MTFB -> Text -- | Helper function for converting a BWTed MTFT back to the -- original Text. textFromBWTFromMTFT :: MTFT -> Text -- | Takes a MTFT and returns the BWT of Texts. textBWTFromMTFT :: MTFT -> BWT Text -- | Takes a MTFT and returns the BWT of ByteStrings. bytestringBWTFromMTFT :: MTFT -> BWT ByteString -- | Takes a MTFB and returns the BWT of Texts. textBWTFromMTFB :: MTFB -> BWT Text -- | Take a MTFB and returns the BWT of ByteStrings. bytestringBWTFromMTFB :: MTFB -> BWT ByteString -- | Takes a MTFB and returns the original Seq of -- Texts. textFromMTFB :: MTFB -> Seq (Maybe Text) -- | Takes a MTFB and returns the original Seq of -- ByteStrings. bytestringFromMTFB :: MTFB -> Seq (Maybe ByteString) -- | Takes a MTFT and returns the original Seq of -- Texts. textFromMTFT :: MTFT -> Seq (Maybe Text) -- | Takes a MTFT and returns the original Seq of -- ByteStrings. bytestringFromMTFT :: MTFT -> Seq (Maybe ByteString) -- |

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 -- Full-text Minute-space index (FM-index) and the Inverse -- FM-index implementations, namely seqToFMIndexB, -- seqToFMIndexT, seqFromFMIndexB, and -- seqFromFMIndexT. -- -- The FM-index 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. module Data.FMIndex.Internal -- | Basic FMIndex (ByteString) data type. newtype FMIndexB FMIndexB :: Seq (Maybe ByteString, Seq (Int, Int, Maybe ByteString)) -> FMIndexB -- | Basic FMIndex (Text) data type. newtype FMIndexT FMIndexT :: Seq (Maybe Text, Seq (Int, Int, Maybe Text)) -> FMIndexT -- | Abstract PBFMIndexSeqB type utilizing a Seq. type PBFMIndexSeqB = Seq (Maybe ByteString) -- | Abstract FMIndexSeqB type utilizing a Seq. -- (c,(indexofinputcurrentelement,Occ(c,k),inputcurrentelement)) Please -- see this for an explanation of the above abbreviations. type FMIndexSeqB = Seq (Maybe ByteString, Seq (Int, Int, Maybe ByteString)) -- | Abstract data type representing a FMIndexSeqB in the (strict) -- ST monad. type STFMIndexSeqB s a = STRef s FMIndexSeqB -- | State function to update FMIndexSeqB with each step of the -- FMIndex. updateSTFMIndexSeqAB :: STFMIndexSeqB s (Seq (Maybe ByteString, Seq (Int, Int, Maybe ByteString))) -> (Int, Int, Maybe ByteString) -> ST s () -- | State function to update FMIndexSeqB with each step of the -- FMIndex. updateSTFMIndexSeqBB :: STFMIndexSeqB s (Seq (Maybe ByteString, Seq (Int, Int, Maybe ByteString))) -> Maybe ByteString -> ST s () -- | State function to create empty STFMIndexSeqB type. emptySTFMIndexSeqB :: ST s (STFMIndexSeqB s a) -- | Abstract STFMIndexILB and associated state type. type STFMIndexILB s a = STRef s (Seq (Maybe ByteString)) -- | State function to load list into STFMIndexILB. loadSTFMIndexILB :: STMTFILB s (Maybe ByteString) -> Seq (Maybe ByteString) -> ST s () -- | State function to create empty STFMIndexILB type. emptySTFMIndexILB :: ST s (STFMIndexILB s a) -- | Abstract STFMIndexCounterB and associated state type. type STFMIndexCounterB s a = STRef s Int -- | State function to update STFMIndexCounterB. updateSTFMIndexCounterB :: STFMIndexCounterB s Int -> Int -> ST s () -- | State function to create empty STFMIndexCounterB type. emptySTFMIndexCounterB :: ST s (STFMIndexCounterB s Int) -- | Strict state monad function. seqToFMIndexB :: PBFMIndexSeqB -> ST s FMIndexSeqB -- | Abstract PTFMIndexSeqT type utilizing a Seq. type PTFMIndexSeqT = Seq (Maybe Text) -- | Abstract FMIndexSeqT type utilizing a Seq. -- (c,(indexofinputcurrentelement,Occ(c,k),inputcurrentelement)) Please -- see this for an explanation of the above abbreviations. type FMIndexSeqT = Seq (Maybe Text, Seq (Int, Int, Maybe Text)) -- | Abstract data type representing a FMIndexSeqT in the (strict) -- ST monad. type STFMIndexSeqT s a = STRef s FMIndexSeqT -- | State function to update FMIndexSeqT with each step of the -- FMIndex. updateSTFMIndexSeqAT :: STFMIndexSeqT s (Seq (Maybe Text, Seq (Int, Int, Maybe Text))) -> (Int, Int, Maybe Text) -> ST s () -- | State function to update FMIndexSeqT with each step of the -- FMIndex. updateSTFMIndexSeqBT :: STFMIndexSeqT s (Seq (Maybe Text, Seq (Int, Int, Maybe Text))) -> Maybe Text -> ST s () -- | State function to create empty STFMIndexSeqT type. emptySTFMIndexSeqT :: ST s (STFMIndexSeqT s a) -- | Abstract STFMIndexILT and associated state type. type STFMIndexILT s a = STRef s (Seq (Maybe Text)) -- | State function to load list into STFMIndexILT. loadSTFMIndexILT :: STMTFILT s (Maybe Text) -> Seq (Maybe Text) -> ST s () -- | State function to create empty STFMIndexILT type. emptySTFMIndexILT :: ST s (STFMIndexILT s a) -- | Abstract STFMIndexCounterT and associated state type. type STFMIndexCounterT s a = STRef s Int -- | State function to update STFMIndexCounterT. updateSTFMIndexCounterT :: STFMIndexCounterT s Int -> Int -> ST s () -- | State function to create empty STFMIndexCounterT type. emptySTFMIndexCounterT :: ST s (STFMIndexCounterT s Int) -- | Strict state monad function. seqToFMIndexT :: PTFMIndexSeqT -> ST s FMIndexSeqT -- | Abstract FFMIndexSeqB type utilizing a Seq. type FFMIndexSeqB = Seq (Maybe ByteString) -- | Simple Inverse FMIndex function. seqFromFMIndexB :: FMIndexB -> FFMIndexSeqB -- | Abstract FFMIndexSeqT type utilizing a Seq. type FFMIndexSeqT = Seq (Maybe Text) -- | Simple Inverse FMIndex function. seqFromFMIndexT :: FMIndexT -> FFMIndexSeqT instance GHC.Generics.Generic Data.FMIndex.Internal.FMIndexB instance GHC.Read.Read Data.FMIndex.Internal.FMIndexB instance GHC.Show.Show Data.FMIndex.Internal.FMIndexB instance GHC.Classes.Ord Data.FMIndex.Internal.FMIndexB instance GHC.Classes.Eq Data.FMIndex.Internal.FMIndexB instance GHC.Generics.Generic Data.FMIndex.Internal.FMIndexT instance GHC.Read.Read Data.FMIndex.Internal.FMIndexT instance GHC.Show.Show Data.FMIndex.Internal.FMIndexT instance GHC.Classes.Ord Data.FMIndex.Internal.FMIndexT instance GHC.Classes.Eq Data.FMIndex.Internal.FMIndexT -- |

Full-text Minute-space index (FM-index)

-- -- Users will get the most mileage by first compressing to a BWT -- on the initial ByteString or Text input before -- compressing to a FMIndexB or FMIndexT. -- -- To do this, users can use the bytestringToBWTToFMIndexB and -- bytestringToBWTToFMIndexT functions, as well as the -- textToBWTToFMIndexB and textToBWTToFMIndexT functions. -- -- The base functions for ByteString, bytestringToFMIndexB -- and bytestringToFMIndexT can be used to convert a Seq -- (Maybe ByteString) to a FMIndexB and -- FMIndexT, respectively. -- -- Likewise, the base functions for Text, textToFMIndexB -- and textToFMIndexT can be used to convert a Seq -- (Maybe Text) to a FMIndexB and FMIndexT -- respectively. -- -- There are various other lower-level functions for interacting with the -- FMIndex implementation on ByteString and Text as well. -- -- Data.FMIndex.Internal contains efficient and stateful -- implementations of the FMIndex and Inverse FMIndex algorithms. module Data.FMIndex -- | Helper function for converting a ByteString to a -- FMIndexB via a BWT first. bytestringToBWTToFMIndexB :: ByteString -> FMIndexB -- | Helper function for converting a ByteString to a -- FMIndexT via a BWT first. bytestringToBWTToFMIndexT :: ByteString -> FMIndexT -- | Helper function for converting a Text to a FMIndexB via -- a BWT first. textToBWTToFMIndexB :: Text -> FMIndexB -- | Helper function for converting a Text to a FMIndexT via -- a BWT first. textToBWTToFMIndexT :: Text -> FMIndexT -- | Take a BWT of Word8s and generate the FM-index -- (FMIndexB). textBWTToFMIndexB :: TextBWT -> FMIndexB -- | Take a BWT of Word8s and generate the FM-index -- (FMIndexB). bytestringBWTToFMIndexB :: BWT Word8 -> FMIndexB -- | Take a BWT of Word8s and generate the FM-index -- (FMIndexB). textBWTToFMIndexT :: TextBWT -> FMIndexT -- | Take a BWT of Word8s and generate the FM-index -- (FMIndexT). bytestringBWTToFMIndexT :: BWT Word8 -> FMIndexT -- | Takes a Text and returns the FM-index (FMIndexB). textToFMIndexB :: Seq (Maybe Text) -> FMIndexB -- | Takes a Seq of ByteStrings and returns the FM-index -- (FMIndexB). bytestringToFMIndexB :: Seq (Maybe ByteString) -> FMIndexB -- | Takes a Text and returns the FM-index (FMIndexT). textToFMIndexT :: Seq (Maybe Text) -> FMIndexT -- | Takes a ByteString and returns the FM-index (FMIndexT). bytestringToFMIndexT :: Seq (Maybe ByteString) -> FMIndexT -- | Helper function for converting a BWTed FMIndexB back to -- the original ByteString. bytestringFromBWTFromFMIndexB :: FMIndexB -> ByteString -- | Helper function for converting a BWTed FMIndexT back to -- the original ByteString. bytestringFromBWTFromFMIndexT :: FMIndexT -> ByteString -- | Helper function for converting a BWTed FMIndexB back to -- the original Text. textFromBWTFromFMIndexB :: FMIndexB -> Text -- | Helper function for converting a BWTed FMIndexT back to -- the original Text. textFromBWTFromFMIndexT :: FMIndexT -> Text -- | Takes a FMIndexT and returns the BWT of Texts. textBWTFromFMIndexT :: FMIndexT -> BWT Text -- | Takes a FMIndexT and returns the BWT of -- ByteStrings. bytestringBWTFromFMIndexT :: FMIndexT -> BWT ByteString -- | Takes a FMIndexB and returns the BWT of Texts. textBWTFromFMIndexB :: FMIndexB -> BWT Text -- | Take a FMIndexB and returns the BWT of -- ByteStrings. bytestringBWTFromFMIndexB :: FMIndexB -> BWT ByteString -- | Takes a FMIndexB and returns the original Seq of -- Texts. textFromFMIndexB :: FMIndexB -> Seq (Maybe Text) -- | Takes a FMIndexB and returns the original Seq of -- ByteStrings. bytestringFromFMIndexB :: FMIndexB -> Seq (Maybe ByteString) -- | Takes a FMIndexT and returns the original Seq of -- Texts. textFromFMIndexT :: FMIndexT -> Seq (Maybe Text) -- | Takes a FMIndexT and returns the original Seq of -- ByteStrings. bytestringFromFMIndexT :: FMIndexT -> Seq (Maybe ByteString) -- |

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. module Data.RLE.Internal -- | Basic RLE (ByteString) data type. newtype RLEB RLEB :: Seq (Maybe ByteString) -> RLEB -- | Basic RLE (Text) data type. newtype RLET RLET :: Seq (Maybe Text) -> RLET -- | Abstract RLESeqB type utilizing a Seq. type RLESeqB = Seq (Maybe ByteString) -- | Abstract data type representing a RLESeqB in the (strict) ST -- monad. type STRLESeqB s a = STRef s RLESeqB -- | State function to push RLESeqB data into stack. pushSTRLESeqB :: STRLESeqB s (Maybe ByteString) -> Maybe ByteString -> ST s () -- | State function to create empty STRLESeqB type. emptySTRLESeqB :: ST s (STRLESeqB s a) -- | Abstract STRLETempB and associated state type. type STRLETempB s a = STRef s (Maybe ByteString) -- | State function to update STRLETempB. updateSTRLETempB :: STRLETempB s (Maybe ByteString) -> Maybe ByteString -> ST s () -- | State function to create empty STRLETempB type. emptySTRLETempB :: ST s (STRLETempB s a) -- | Abstract STRLECounterB state type. type STRLECounterB s a = STRef s Int -- | State function to update STRLECounterB. updateSTRLECounterB :: STRLECounterB s Int -> Int -> ST s () -- | State function to create empty STRLECounterB type. emptySTRLECounterB :: ST s (STRLECounterB s Int) -- | Strict state monad function. seqToRLEB :: RLESeqB -> ST s RLESeqB -- | Abstract RLESeqT type utilizing a Seq. type RLESeqT = Seq (Maybe Text) -- | Abstract data type representing a RLESeqT in the (strict) ST -- monad. type STRLESeqT s a = STRef s RLESeqT -- | State function to push RLESeqT data into stack. pushSTRLESeqT :: STRLESeqT s (Maybe Text) -> Maybe Text -> ST s () -- | State function to create empty STRLESeqT type. emptySTRLESeqT :: ST s (STRLESeqT s a) -- | Abstract STRLETempT state type. type STRLETempT s a = STRef s (Maybe Text) -- | State function to update STRLETempT. updateSTRLETempT :: STRLETempT s (Maybe Text) -> Maybe Text -> ST s () -- | State function to create empty STRLETempT type. emptySTRLETempT :: ST s (STRLETempT s a) -- | Abstract STRLECounterT and associated state type. type STRLECounterT s a = STRef s Int -- | State function to update STRLECounterT. updateSTRLECounterT :: STRLECounterT s Int -> Int -> ST s () -- | State function to create empty STRLECounterT type. emptySTRLECounterT :: ST s (STRLECounterT s Int) -- | Strict state monad function. seqToRLET :: RLESeqT -> ST s RLESeqT -- | Abstract FRLESeqB type utilizing a Seq. type FRLESeqB = Seq (Maybe ByteString) -- | Abstract data type representing a FRLESeqB in the (strict) ST -- monad. type FSTRLESeqB s a = STRef s FRLESeqB -- | State function to push FRLESeqB data into stack. pushFSTRLESeqB :: FSTRLESeqB s (Maybe ByteString) -> Maybe ByteString -> ST s () -- | State function to create empty FSTRLESeqB type. emptyFSTRLESeqB :: ST s (FSTRLESeqB s a) -- | Strict state monad function. seqFromRLEB :: RLEB -> ST s FRLESeqB -- | Abstract FRLESeqT type utilizing a Seq. type FRLESeqT = Seq (Maybe Text) -- | Abstract data type representing a FRLESeqT in the (strict) ST -- monad. type FSTRLESeqT s a = STRef s FRLESeqT -- | State function to push FSTRLESeqT data into stack. pushFSTRLESeqT :: FSTRLESeqT s (Maybe Text) -> Maybe Text -> ST s () -- | State function to create empty FSTRLESeqT type. emptyFSTRLESeqT :: ST s (FSTRLESeqT s a) -- | Strict state monad function. seqFromRLET :: RLET -> ST s FRLESeqT instance GHC.Generics.Generic Data.RLE.Internal.RLEB instance GHC.Read.Read Data.RLE.Internal.RLEB instance GHC.Show.Show Data.RLE.Internal.RLEB instance GHC.Classes.Ord Data.RLE.Internal.RLEB instance GHC.Classes.Eq Data.RLE.Internal.RLEB instance GHC.Generics.Generic Data.RLE.Internal.RLET instance GHC.Read.Read Data.RLE.Internal.RLET instance GHC.Show.Show Data.RLE.Internal.RLET instance GHC.Classes.Ord Data.RLE.Internal.RLET instance GHC.Classes.Eq Data.RLE.Internal.RLET -- |

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. module Data.RLE -- | Helper function for converting a ByteString to a RLEB -- via a BWT first. bytestringToBWTToRLEB :: ByteString -> RLEB -- | Helper function for converting a ByteString to a RLET -- via a BWT first. bytestringToBWTToRLET :: ByteString -> RLET -- | Helper function for converting a Text to a RLEB via a -- BWT first. textToBWTToRLEB :: Text -> RLEB -- | Helper function for converting a Text to a RLET via a -- BWT first. textToBWTToRLET :: Text -> RLET -- | Take a BWT of Word8s and generate the Run-length -- encoding (RLEB). textBWTToRLEB :: TextBWT -> RLEB -- | Take a BWT of Word8s and generate the Run-length -- encoding (RLEB). bytestringBWTToRLEB :: BWT Word8 -> RLEB -- | Take a BWT of Word8s and generate the Run-length -- encoding (RLEB). textBWTToRLET :: TextBWT -> RLET -- | Take a BWT of Word8s and generate the Run-length -- encoding (RLET). bytestringBWTToRLET :: BWT Word8 -> RLET -- | Takes a Text and returns the Run-length encoding (RLEB). textToRLEB :: Seq (Maybe Text) -> RLEB -- | Takes a Seq of ByteStrings and returns the Run-length -- encoding (RLEB). bytestringToRLEB :: Seq (Maybe ByteString) -> RLEB -- | Takes a Text and returns the Run-length encoding (RLE). textToRLET :: Seq (Maybe Text) -> RLET -- | Takes a ByteString and returns the Run-length encoding (RLE). bytestringToRLET :: Seq (Maybe ByteString) -> RLET -- | Helper function for converting a BWTed RLEB back to the -- original ByteString. bytestringFromBWTFromRLEB :: RLEB -> ByteString -- | Helper function for converting a BWTed RLET back to the -- original ByteString. bytestringFromBWTFromRLET :: RLET -> ByteString -- | Helper function for converting a BWTed RLEB back to the -- original Text. textFromBWTFromRLEB :: RLEB -> Text -- | Helper function for converting a BWTed RLET back to the -- original Text. textFromBWTFromRLET :: RLET -> Text -- | Takes a RLET and returns the BWT of Texts. textBWTFromRLET :: RLET -> BWT Text -- | Takes a RLET and returns the BWT of ByteStrings. bytestringBWTFromRLET :: RLET -> BWT ByteString -- | Takes a RLEB and returns the BWT of Texts. textBWTFromRLEB :: RLEB -> BWT Text -- | Take a RLEB and returns the BWT of ByteStrings. bytestringBWTFromRLEB :: RLEB -> BWT ByteString -- | Takes a RLEB and returns the original Seq of -- Texts. textFromRLEB :: RLEB -> Seq (Maybe Text) -- | Takes a RLEB and returns the original Seq of -- ByteStrings. bytestringFromRLEB :: RLEB -> Seq (Maybe ByteString) -- | Takes a RLET and returns the original Seq of -- Texts. textFromRLET :: RLET -> Seq (Maybe Text) -- | Takes a RLET and returns the original Seq of -- ByteStrings. bytestringFromRLET :: RLET -> Seq (Maybe ByteString)