beamable-0.1.1.1: Generic serializer/deserializer with compact representation

Safe HaskellNone

Data.Beamable.Internal

Synopsis

Documentation

class Beamable a whereSource

Methods

beam :: a -> BuilderSource

Serialize value into Builder

unbeam :: ByteString -> (a, ByteString)Source

Deserialize next value from ByteString, also returns leftovers

typeSignR :: [String] -> a -> Word64Source

Get value's type signature, should work fine on undefined values takes list of strings with datatypes which already been traversed workaround to support recursive datatypes. In most cases you should be passing empty list in there.

typeSign :: Beamable a => a -> Word64Source

Get type signature of arbitrary Beamable datatatype encoded as Word64 hash with all constructors and datatypes in it. It's preferable to use typeSign against typeSignR, because implementation of later might change.

data Phantom a Source

Phantom a has just one possible value, like (), and is encoded as a 0-byte sequence. However, its typeSign depends on the typeSign of its parameter.

Constructors

Phantom 

Instances