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

Morley.Michelson.TypeCheck.Error

Description

Errors that can occur when some code is being typechecked.

Synopsis

Documentation

data TypeContext Source #

Contexts where type error can occur.

Instances

Instances details
Generic TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep TypeContext :: Type -> Type #

Show TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

NFData TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: TypeContext -> () #

Buildable TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: TypeContext -> Builder #

Eq TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

RenderDoc TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TypeContext = D1 ('MetaData "TypeContext" "Morley.Michelson.TypeCheck.Error" "morley-1.18.0-inplace" 'False) ((((C1 ('MetaCons "LambdaArgument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LambdaCode" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DipCode" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ConsArgument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ComparisonArguments" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ContractParameter" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ContractStorage" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ArithmeticOperation" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Iteration" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cast" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "UnpairArgument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CarArgument" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CdrArgument" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "If" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ConcatArgument" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ContainerKeyType" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ContainerValueType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FailwithArgument" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "TicketsJoin" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ViewBlock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EmitArgument" 'PrefixI 'False) (U1 :: Type -> Type))))))

data TopLevelType Source #

Instances

Instances details
Generic TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep TopLevelType :: Type -> Type #

Show TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

NFData TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: TopLevelType -> () #

Buildable TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Eq TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

RenderDoc TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TopLevelType = D1 ('MetaData "TopLevelType" "Morley.Michelson.TypeCheck.Error" "morley-1.18.0-inplace" 'False) (C1 ('MetaCons "TltParameterType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TltStorageType" 'PrefixI 'False) (U1 :: Type -> Type))

data TCTypeError Source #

Data type that represents various errors which are related to type system. These errors are used to specify info about type check errors in TCError data type.

Constructors

TypeEqError (MismatchError T)

Type equality error

StackEqError (MismatchError [T])

Stacks equality error

UnsupportedTypeForScope T BadTypeForScope

Error that happens when type cannot be used in the corresponding scope. Argument of this constructor carries type which violates the restriction, e.g. big_map in UNPACK, and a concrete reason why the type is unsuported.

NotNumericTypes T T

Arithmetic operation is applied to types, at least one of which is not numeric (e.g. timestamp and timestamp passed to MUL instruction).

UnexpectedType (NonEmpty (NonEmpty Text))

Error that happens when actual types are different from the type that instruction expects. The param is an non-empty list of all expected stack types that the instruction would accept. Each expected stack types is represented as non-empty list as well.

UnexpectedTopLevelType TopLevelType (MismatchError T)

Error that happens when the caller expected one top-level type, but the contract has another type specified.

InvalidInstruction ExpandedInstr Text

Some instruction is invalid or used in an invalid way. For example, PAIR 0 or PAIR 1, or a SELF instruction was used in a LAMBDA. The Text argument is a user-readable explanation of why this instruction is invalid.

InvalidValueType T

Error that happens when a Value is never a valid source for this type (e.g. timestamp cannot be obtained from a ValueTrue)

NotEnoughItemsOnStack

There are not enough items on stack to perform a certain instruction.

IllegalEntrypoint EpNameFromRefAnnError

Invalid entrypoint name provided

UnknownContract ContractAddress

Contract with given address is not originated.

TxRollupContract TxRollupAddress

Provided txr1 address as contract.

EntrypointNotFound EpName

Given entrypoint is not present.

IllegalParamDecl ParamEpError

Incorrect parameter declaration (with respect to entrypoints feature).

NegativeNat

Natural numbers cannot be negative

MutezOverflow

Exceeds the maximal mutez value

InvalidAddress ParseEpAddressError

Address couldn't be parsed from its textual representation

InvalidKeyHash CryptoParseError

KeyHash couldn't be parsed from its textual representation

InvalidBls12381Object DeserializationError

BLS12-381 primitive couldn't be parsed

InvalidTimestamp

Timestamp is not RFC339 compliant

CodeAlwaysFails

Code always fails, but shouldn't, like in ITER body. This is actually more general, any instruction that allows no continuation (like NEVER) cannot appear as part of another instruction's body.

EmptyCode

Empty block of code, like ITER body.

AnyError

Generic error when instruction does not match something sensible.

InvalidBigMapId Integer

A big_map with the given ID was not found.

UnexpectedBigMapType

We found a big_map with the given big_map ID, but its key and/or value types are not the same as the requested types.

Fields

Instances

Instances details
Generic TCTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep TCTypeError :: Type -> Type #

Show TCTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

NFData TCTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: TCTypeError -> () #

Buildable TCTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: TCTypeError -> Builder #

Eq TCTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

RenderDoc TCTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TCTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TCTypeError = D1 ('MetaData "TCTypeError" "Morley.Michelson.TypeCheck.Error" "morley-1.18.0-inplace" 'False) ((((C1 ('MetaCons "TypeEqError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MismatchError T))) :+: (C1 ('MetaCons "StackEqError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MismatchError [T]))) :+: C1 ('MetaCons "UnsupportedTypeForScope" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 T) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BadTypeForScope)))) :+: (C1 ('MetaCons "NotNumericTypes" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 T) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 T)) :+: (C1 ('MetaCons "UnexpectedType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty (NonEmpty Text)))) :+: C1 ('MetaCons "UnexpectedTopLevelType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TopLevelType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MismatchError T)))))) :+: ((C1 ('MetaCons "InvalidInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExpandedInstr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :+: (C1 ('MetaCons "InvalidValueType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 T)) :+: C1 ('MetaCons "NotEnoughItemsOnStack" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "IllegalEntrypoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 EpNameFromRefAnnError)) :+: (C1 ('MetaCons "UnknownContract" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ContractAddress)) :+: C1 ('MetaCons "TxRollupContract" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TxRollupAddress)))))) :+: (((C1 ('MetaCons "EntrypointNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 EpName)) :+: (C1 ('MetaCons "IllegalParamDecl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParamEpError)) :+: C1 ('MetaCons "NegativeNat" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "MutezOverflow" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InvalidAddress" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParseEpAddressError)) :+: C1 ('MetaCons "InvalidKeyHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CryptoParseError))))) :+: ((C1 ('MetaCons "InvalidBls12381Object" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DeserializationError)) :+: (C1 ('MetaCons "InvalidTimestamp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CodeAlwaysFails" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "EmptyCode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AnyError" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InvalidBigMapId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer)) :+: C1 ('MetaCons "UnexpectedBigMapType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MismatchError T))))))))

data TCError Source #

Type check error

Instances

Instances details
Exception TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Generic TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep TCError :: Type -> Type #

Methods

from :: TCError -> Rep TCError x #

to :: Rep TCError x -> TCError #

Show TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

NFData TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: TCError -> () #

Buildable TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: TCError -> Builder #

Eq TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

(==) :: TCError -> TCError -> Bool #

(/=) :: TCError -> TCError -> Bool #

RenderDoc TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TCError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TCError = D1 ('MetaData "TCError" "Morley.Michelson.TypeCheck.Error" "morley-1.18.0-inplace" 'False) (((C1 ('MetaCons "TCFailedOnInstr" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExpandedInstr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SomeHST)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ErrorSrcPos) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TypeContext)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TCTypeError))))) :+: C1 ('MetaCons "TCFailedOnValue" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Value) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 T)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ErrorSrcPos) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TCTypeError)))))) :+: (C1 ('MetaCons "TCContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TCTypeError))) :+: C1 ('MetaCons "TCViewError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ViewName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TCTypeError)))))) :+: ((C1 ('MetaCons "TCUnreachableCode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ErrorSrcPos) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty ExpandedOp))) :+: C1 ('MetaCons "TCExtError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SomeHST) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ErrorSrcPos) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExtError)))) :+: (C1 ('MetaCons "TCIncompletelyTyped" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TCError) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Contract' TypeCheckedOp))) :+: C1 ('MetaCons "TCIncompletelyTypedView" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TCError) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (View' TypeCheckedOp))))))

data ExtError Source #

Various type errors possible when checking Morley extension commands

Instances

Instances details
Generic ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep ExtError :: Type -> Type #

Methods

from :: ExtError -> Rep ExtError x #

to :: Rep ExtError x -> ExtError #

Show ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

NFData ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: ExtError -> () #

Buildable ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: ExtError -> Builder #

Eq ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep ExtError = D1 ('MetaData "ExtError" "Morley.Michelson.TypeCheck.Error" "morley-1.18.0-inplace" 'False) ((C1 ('MetaCons "LengthMismatch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StackTypePattern)) :+: C1 ('MetaCons "TypeMismatch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StackTypePattern) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TCTypeError)))) :+: (C1 ('MetaCons "StkRestMismatch" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StackTypePattern) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SomeHST)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SomeHST) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TCTypeError))) :+: (C1 ('MetaCons "TestAssertError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "InvalidStackReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StackRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StackSize)))))

newtype StackSize Source #

Constructors

StackSize Natural 

Instances

Instances details
Generic StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep StackSize :: Type -> Type #

Show StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

NFData StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: StackSize -> () #

Buildable StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: StackSize -> Builder #

Eq StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep StackSize = D1 ('MetaData "StackSize" "Morley.Michelson.TypeCheck.Error" "morley-1.18.0-inplace" 'True) (C1 ('MetaCons "StackSize" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

pairWithNodeIndex :: Word -> Text Source #

Given a node index ix, creates a string representing the smallest possible right-combed pair with at least ix+1 nodes.

Since the node index 0 is valid even for non-pair values (e.g. we can run GET 0 on a string or an int), we simply return a type variable 'a in this case.

>>> pairWithNodeIndex 0
"'a"
>>> pairWithNodeIndex 4
"pair 'a1 'a2 'a3"
>>> pairWithNodeIndex 5
"pair 'a1 'a2 'a3 'a4"

pairWithElems :: Word -> Text Source #

Given a number n, creates a string representing a right-combed pair of arity n.

pairType 3 == "pair 'a1 'a2 'a3"