morley-1.20.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Micheline.Binary.Internal

Description

Defines binary encoding primitives which mimic Tezos' binary encoding.

Synopsis

Documentation

newtype DynamicSize a Source #

Constructors

DynamicSize 

Fields

readZ :: forall a. (Integral a, Bits a) => Int -> a -> Get a Source #

writeZ :: forall a. (Integral a, Bits a) => Int -> a -> Builder Source #

buildNatural :: Integer -> Builder Source #

Build a binary representation of a Zarith natural. This function is partial, only defined for nonnegative Integers.

The reason it's not defined to accept a Natural is mostly to avoid fromIntegral/toInteger conversions at the use sites, since not all libraries, notably cryptonite, support Natural.