-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Grammar-based compression algorithms SEQUITUR -- -- Please see the README on GitHub at -- https://github.com/msakai/haskell-sequitur#readme @package sequitur @version 0.1.0.0 -- | SEQUITUR is a linear-time, online algorithm for producing a -- context-free grammar from an input sequence. The resulting grammar is -- a compact representation of original sequence and can be used for data -- compression. -- -- Example: -- --
-- decode = toList . decodeToSeq ---- -- and provided just for convenience. For serious usage, use -- decodeToSeq or decodeLazy. decode :: HasCallStack => Grammar a -> [a] -- | A variant of decode but you can consume from the beginning -- before constructing entire sequence. decodeLazy :: HasCallStack => Grammar a -> [a] -- | A variant of decode with possibly better performance. decodeToSeq :: HasCallStack => Grammar a -> Seq a -- | Monoid-based folding over the decoded sequence. -- -- This function is equivalent to the following definition, is more -- efficent due to the utilization of sharing.b -- --
-- decodeToMonoid f = mconcat . map f . decode --decodeToMonoid :: (Monoid m, HasCallStack) => (a -> m) -> Grammar a -> m -- | Builder denotes a internal state of the SEQUITUR -- algorithm. data Builder s a -- | Create a new Builder. newBuilder :: PrimMonad m => m (Builder (PrimState m) a) -- | Add a new symbol to the end of grammar's start production, and perform -- normalization to keep the invariants of SEQUITUR algorithm. add :: (PrimMonad m, Eq a, Hashable a) => Builder (PrimState m) a -> a -> m () -- | Retrieve a grammar (as a persistent data structure) from -- Builder's internal state. build :: PrimMonad m => Builder (PrimState m) a -> m (Grammar a) instance GHC.Generics.Generic (Language.Grammar.Sequitur.Symbol a) instance GHC.Show.Show a => GHC.Show.Show (Language.Grammar.Sequitur.Symbol a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Language.Grammar.Sequitur.Symbol a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Grammar.Sequitur.Symbol a) instance GHC.Generics.Generic (Language.Grammar.Sequitur.Node s a) instance GHC.Classes.Eq (Language.Grammar.Sequitur.Rule s a) instance Data.Hashable.Class.Hashable (Language.Grammar.Sequitur.Rule s a) instance GHC.Classes.Eq (Language.Grammar.Sequitur.Node s a) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Language.Grammar.Sequitur.Symbol a)