bert- BERT implementation

Safe HaskellNone



Define BERT terms their binary encoding & decoding and a typeclass for converting Haskell values to BERT terms and back.

We define a number of convenient instances for BERT. Users will probably want to define their own instances for composite types.



class BERT a where Source


showBERT :: a -> Term Source

Introduce a Term from a Haskell value.

readBERT :: Term -> Either String a Source

Attempt to read a haskell value from a Term.


BERT Bool Source 
BERT Float Source 
BERT Int Source 
BERT Integer Source 
BERT String Source 
BERT ByteString Source 
BERT Term Source 
BERT a => BERT [a] Source 
(BERT a, BERT b) => BERT (a, b) Source 
(Ord k, BERT k, BERT v) => BERT (Map k v) Source 
(BERT a, BERT b, BERT c) => BERT (a, b, c) Source 
(BERT a, BERT b, BERT c, BERT d) => BERT (a, b, c, d) Source 

parseTerm :: String -> Either ParseError Term Source

Parse a simple BERT (erlang) term from a string in the erlang grammar. Does not attempt to decompose complex terms.