Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- typeCheckContract :: Contract -> Either TCError SomeContract
- typeCheckContractAndStorage :: Contract -> Value -> Either TCError SomeContractAndStorage
- typeCheckStorage :: Type -> Value -> Either TCError SomeValue
- typeCheckParameter :: TcOriginatedContracts -> Type -> Value -> Either TCError SomeValue
- typeVerifyStorage :: SingI t => Value -> Either TCError (Value t)
- typeVerifyParameter :: SingI t => TcOriginatedContracts -> Value -> Either TCError (Value t)
- typeCheckValue :: forall t. SingI t => Value -> TypeCheckInstr (Value t)
- typeCheckList :: Typeable inp => [ExpandedOp] -> HST inp -> TypeCheck (SomeInstr inp)
- typeCheckExt :: forall s. Typeable s => TypeCheckListHandler s -> ExpandedExtInstr -> HST s -> TypeCheckInstr (SomeInstr s)
- module Michelson.TypeCheck.Error
- module Michelson.TypeCheck.Types
- module Michelson.TypeCheck.TypeCheck
- eqType :: forall (a :: T) (b :: T). Each '[KnownT] [a, b] => Either TCTypeError (a :~: b)
- matchTypes :: forall t1 t2. Each '[KnownT] [t1, t2] => Notes t1 -> Notes t2 -> Either TCTypeError (t1 :~: t2, Notes t1)
Documentation
typeCheckContractAndStorage :: Contract -> Value -> Either TCError SomeContractAndStorage Source #
Type check a contract and verify that the given storage is of the type expected by the contract.
typeCheckStorage :: Type -> Value -> Either TCError SomeValue Source #
Like typeCheckValue
, but for values to be used as storage.
typeCheckParameter :: TcOriginatedContracts -> Type -> Value -> Either TCError SomeValue Source #
Like typeCheckValue
, but for values to be used as parameter.
Also accepts a TcOriginatedContracts
in order to be able to type-check
contract p
values (which can only be part of a parameter).
typeVerifyParameter :: SingI t => TcOriginatedContracts -> Value -> Either TCError (Value t) Source #
typeCheckValue :: forall t. SingI t => Value -> TypeCheckInstr (Value t) Source #
Function typeCheckValue
converts a single Michelson value
given in representation from Michelson.Untyped
module hierarchy to
representation in strictly typed GADT.
typeCheckValue
is polymorphic in the expected type of value.
Type checking algorithm pattern-matches on parse value representation,
expected type t
and constructs Value t
value.
If there was no match on a given pair of value and expected type, that is interpreted as input of wrong type and type check finishes with error.
typeCheckList :: Typeable inp => [ExpandedOp] -> HST inp -> TypeCheck (SomeInstr inp) Source #
Function typeCheckList
converts list of Michelson instructions
given in representation from Michelson.Type
module to representation
in strictly typed GADT.
Types are checked along the way which is neccessary to construct a strictly typed value.
As a second argument, typeCheckList
accepts input stack type representation.
typeCheckExt :: forall s. Typeable s => TypeCheckListHandler s -> ExpandedExtInstr -> HST s -> TypeCheckInstr (SomeInstr s) Source #
module Michelson.TypeCheck.Error
module Michelson.TypeCheck.Types