morley-1.20.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 -> () #

Eq TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Buildable TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: TypeContext -> Doc

buildList :: [TypeContext] -> Doc

type Rep TypeContext Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TypeContext = D1 ('MetaData "TypeContext" "Morley.Michelson.TypeCheck.Error" "morley-1.20.0-inplace" 'False) ((((C1 ('MetaCons "LambdaArgument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LambdaCodeCtx" '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 -> () #

Eq TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Buildable TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: TopLevelType -> Doc

buildList :: [TopLevelType] -> Doc

type Rep TopLevelType Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TopLevelType = D1 ('MetaData "TopLevelType" "Morley.Michelson.TypeCheck.Error" "morley-1.20.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 (InstrAbstract [] ()) 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.

Since this makes sense only for primitive instructions, we keep U.InstrAbstract with () type argument.

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.

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
Exception TcTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

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 -> () #

Eq TcTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Buildable TcTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: TcTypeError -> Doc

buildList :: [TcTypeError] -> Doc

type Rep TcTypeError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep TcTypeError = D1 ('MetaData "TcTypeError" "Morley.Michelson.TypeCheck.Error" "morley-1.20.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 (InstrAbstract [] ())) :*: 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 "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' op Source #

Type check error

Instances

Instances details
Exception TcError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Generic (TcError' op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep (TcError' op) :: Type -> Type #

Methods

from :: TcError' op -> Rep (TcError' op) x #

to :: Rep (TcError' op) x -> TcError' op #

Show op => Show (TcError' op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

showsPrec :: Int -> TcError' op -> ShowS #

show :: TcError' op -> String #

showList :: [TcError' op] -> ShowS #

(NFData op, NFData (TypeCheckedOp op)) => NFData (TcError' op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: TcError' op -> () #

Eq op => Eq (TcError' op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

(==) :: TcError' op -> TcError' op -> Bool #

(/=) :: TcError' op -> TcError' op -> Bool #

(RenderDoc op, Buildable op) => Buildable (TcError' op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: TcError' op -> Doc

buildList :: [TcError' op] -> Doc

type Rep (TcError' op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep (TcError' op) = D1 ('MetaData "TcError'" "Morley.Michelson.TypeCheck.Error" "morley-1.20.0-inplace" 'False) (((C1 ('MetaCons "TcFailedOnInstr" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (InstrAbstract [] op)) :*: 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' [] op)) :*: 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 op))) :+: 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' op)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Contract' (TCOpSeq op)))) :+: (C1 ('MetaCons "TcIncompletelyTypedView" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TcError' op)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (View' (TCOpSeq op)))) :+: C1 ('MetaCons "TcDeprecatedType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 T))))))

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 -> () #

Eq ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Buildable ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: ExtError -> Doc

buildList :: [ExtError] -> Doc

type Rep ExtError Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep ExtError = D1 ('MetaData "ExtError" "Morley.Michelson.TypeCheck.Error" "morley-1.20.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 -> () #

Eq StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Buildable StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

build :: StackSize -> Doc

buildList :: [StackSize] -> Doc

type Rep StackSize Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

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

newtype TCOpSeq op Source #

Used to smooth out the impedance mismatch between instruction arguments, which must be sequences, and contract/view code which can be a singular instruction. Only used for error reporting, as in general this isn't valid.

Constructors

TCOpSeq [TypeCheckedOp op] 

Instances

Instances details
Functor TCOpSeq Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

fmap :: (a -> b) -> TCOpSeq a -> TCOpSeq b #

(<$) :: a -> TCOpSeq b -> TCOpSeq a #

Generic (TCOpSeq op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Associated Types

type Rep (TCOpSeq op) :: Type -> Type #

Methods

from :: TCOpSeq op -> Rep (TCOpSeq op) x #

to :: Rep (TCOpSeq op) x -> TCOpSeq op #

Show op => Show (TCOpSeq op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

showsPrec :: Int -> TCOpSeq op -> ShowS #

show :: TCOpSeq op -> String #

showList :: [TCOpSeq op] -> ShowS #

NFData op => NFData (TCOpSeq op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

rnf :: TCOpSeq op -> () #

Eq op => Eq (TCOpSeq op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

Methods

(==) :: TCOpSeq op -> TCOpSeq op -> Bool #

(/=) :: TCOpSeq op -> TCOpSeq op -> Bool #

RenderDoc op => RenderDoc (TCOpSeq op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep (TCOpSeq op) Source # 
Instance details

Defined in Morley.Michelson.TypeCheck.Error

type Rep (TCOpSeq op) = D1 ('MetaData "TCOpSeq" "Morley.Michelson.TypeCheck.Error" "morley-1.20.0-inplace" 'True) (C1 ('MetaCons "TCOpSeq" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TypeCheckedOp op])))

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"