Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Michelson types represented in untyped model.
Synopsis
- data Ty = Ty ~T TypeAnn
- data T
- = TKey
- | TUnit
- | TSignature
- | TChainId
- | TOption Ty
- | TList Ty
- | TSet Ty
- | TOperation
- | TContract Ty
- | TTicket Ty
- | TPair FieldAnn FieldAnn VarAnn VarAnn Ty Ty
- | TOr FieldAnn FieldAnn Ty Ty
- | TLambda Ty Ty
- | TMap Ty Ty
- | TBigMap Ty Ty
- | TInt
- | TNat
- | TString
- | TBytes
- | TMutez
- | TBool
- | TKeyHash
- | TBls12381Fr
- | TBls12381G1
- | TBls12381G2
- | TTimestamp
- | TAddress
- | TChest
- | TChestKey
- | TSaplingState Natural
- | TSaplingTransaction Natural
- | TNever
- data ParameterType = ParameterType Ty RootAnn
- toption :: Ty -> T
- tpair :: Ty -> Ty -> T
- tor :: Ty -> Ty -> T
- tyint :: Ty
- tynat :: Ty
- tyunit :: Ty
- tybool :: Ty
- typair :: Ty -> Ty -> Ty
- tyor :: Ty -> Ty -> Ty
- tyImplicitAccountParam :: Ty
- isAtomicType :: Ty -> Bool
- isKey :: Ty -> Bool
- isSignature :: Ty -> Bool
- isComparable :: Ty -> Bool
- isMutez :: Ty -> Bool
- isKeyHash :: Ty -> Bool
- isBool :: Ty -> Bool
- isString :: Ty -> Bool
- isInteger :: Ty -> Bool
- isTimestamp :: Ty -> Bool
- isNat :: Ty -> Bool
- isInt :: Ty -> Bool
- isBytes :: Ty -> Bool
- renderType :: T -> Bool -> RenderContext -> AnnotationSet -> Doc
- unwrapT :: Ty -> T
Documentation
Instances
Michelson Type
Instances
data ParameterType Source #
Since Babylon parameter type can have special root annotation.
Instances
tyImplicitAccountParam :: Ty Source #
For implicit account, which Ty its parameter seems to have from outside.
isAtomicType :: Ty -> Bool Source #
Check if type is atomic.
isSignature :: Ty -> Bool Source #
Predicate checking if type is signature
isComparable :: Ty -> Bool Source #
Predicate checking if type is comparable, i.e. true for int
, nat
, string
, etc.
see https://tezos.gitlab.io/michelson-reference/ for a complete list of comparable types.
isInteger :: Ty -> Bool Source #
Predicate checking if type is integral, i.e. nat
, int
, mutez
, or timestamp
isTimestamp :: Ty -> Bool Source #
Predicate checking if type is timestamp
renderType :: T -> Bool -> RenderContext -> AnnotationSet -> Doc Source #
Render a type representation
Ordering between different kinds of annotations is not significant, but ordering among annotations of the same kind is. Annotations of a same kind must be grouped together.
(prim @v :t %x arg1 arg2 ...)
these are equivalent
PAIR :t @my_pair %x %y PAIR %x %y :t @my_pair