import Prelude hiding (init)

import qualified Data.Map as M

+import qualified Data.Sequence as S

-- * appending a symbol to rule S;

| Rule Integer -- A rule.

+-- | This is a rule's body

+type RuleBody a = S.Seq (Symbol a)

-- | This is the compressor data types.

data Compressor a = Compressor {

- rules :: M.Map Integer ~~[Symbol a]~~ -- The list of rules defined.

+ rules :: M.Map Integer (RuleBody a) -- The list of rules defined.

, ruleCount :: Integer -- The number of rules defined.

-- | This returns the rule of a given number.

-rule :: Eq a => Compressor a -> Integer -> ~~[Symbol~~ a~~]~~

+rule :: Eq a => Compressor a -> Integer -> RuleBody a

- M.findWithDefault ~~[]~~ key $ rules compressor

+ M.findWithDefault S.empty key $ rules compressor

-- | This returns a new, empty compressor.

feed :: Eq a => Compressor a -> a -> Compressor a

feed compressor _ = compressor

+-- | This appends a symbol to a rule.

+append :: Eq a => Compressor a -> Integer -> a -> Compressor a

+append compressor _ _ = compressor

+-- | This uses an existing rule.

+use :: Compressor a -> Integer -> Compressor a

+use compressor _ = compressor

+-- | This creates a new rule.

+create :: Compressor a -> (Integer, Compressor a)

+create compressor = (0, compressor)

+-- | This deletes a rule.

+delete :: Compressor a -> Integer -> Compressor a

+delete compressor _ = compressor