Portability | portable |
---|---|
Stability | experimental |
Maintainer | amy@nualeargais.ie |
Safe Haskell | None |
Lookup table for encoding genes.
Coding schemes
An encoding scheme.
Encoding and decoding
encode :: Eq a => Code a b -> a -> Maybe [b]Source
Encodes a value as a sequence of letters in the code alphabet.
encodeNext :: Eq a => Code a b -> a -> [b] -> [b]Source
Encodes a value and append it to the sequence provided. If the value cannot be encoded, the sequence is returned unmodified.
decode :: Eq b => Code a b -> [b] -> Maybe aSource
Returns the value corresponding to a sequence of letters in the code alphabet.
decodeNext :: Eq b => Code a b -> [b] -> Maybe (a, [b])Source
Decodes a value from a sequence, and returns the value and the unused portion of the sequence.