morley-1.7.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Util.Binary

Description

Module contains helper functions when dealing with encoding and decoding Binary

Synopsis

Documentation

newtype UnpackError Source #

Any decoding error.

Constructors

UnpackError 

Fields

Instances

Instances details
Eq UnpackError Source # 
Instance details

Defined in Util.Binary

Show UnpackError Source # 
Instance details

Defined in Util.Binary

Exception UnpackError Source # 
Instance details

Defined in Util.Binary

Buildable UnpackError Source # 
Instance details

Defined in Util.Binary

Methods

build :: UnpackError -> Builder #

data TaggedDecoder a Source #

Describes how decodeWithTag should decode tag-dependent data. We expect bytes of such structure: tdTag followed by a bytestring which will be parsed with tdDecoder.

Constructors

TaggedDecoder 

Fields

(#:) :: Word8 -> Get a -> TaggedDecoder a infixr 0 Source #

Alias for TaggedDecoder constructor.

getByteStringCopy :: Int -> Get ByteString Source #

Get a bytestring of the given length leaving no references to the original data in serialized form.

getRemainingByteStringCopy :: Get ByteString Source #

Get remaining available bytes.

Note that reading all remaining decoded input may be expensive and is thus discouraged, use can use this function only when you know that amount of data to be consumed is limited, e.g. within decodeAsBytes call.

unknownTag :: String -> Word8 -> Get a Source #

Fail with "unknown tag" error.