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 -> RenderContext -> AnnotationSet -> Doc
- unwrapT :: Ty -> T
Documentation
Instances
FromJSON Ty Source # | |
ToJSON Ty Source # | |
Defined in Morley.Michelson.Untyped.Type | |
Data Ty Source # | |
Defined in Morley.Michelson.Untyped.Type gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ty -> c Ty # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ty # dataTypeOf :: Ty -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ty) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ty) # gmapT :: (forall b. Data b => b -> b) -> Ty -> Ty # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ty -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ty -> r # gmapQ :: (forall d. Data d => d -> u) -> Ty -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ty -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ty -> m Ty # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ty -> m Ty # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ty -> m Ty # | |
Generic Ty Source # | |
Show Ty Source # | |
NFData Ty Source # | |
Defined in Morley.Michelson.Untyped.Type | |
Eq Ty Source # | |
ToExpression Ty Source # | |
Defined in Morley.Micheline.Class toExpression :: Ty -> Expression Source # | |
RenderDoc Ty Source # | |
Defined in Morley.Michelson.Untyped.Type renderDoc :: RenderContext -> Ty -> Doc Source # isRenderable :: Ty -> Bool Source # | |
HasCLReader Ty Source # | |
Defined in Morley.CLI | |
FromExp x Ty Source # | |
Defined in Morley.Micheline.Class | |
Lift Ty Source # | |
Buildable (MismatchError Ty) Source # | |
Defined in Morley.Michelson.Untyped.Type build :: MismatchError Ty -> Doc buildList :: [MismatchError Ty] -> Doc | |
type Rep Ty Source # | |
Defined in Morley.Michelson.Untyped.Type type Rep Ty = D1 ('MetaData "Ty" "Morley.Michelson.Untyped.Type" "morley-1.19.2-inplace" 'False) (C1 ('MetaCons "Ty" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 T) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TypeAnn))) |
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 -> 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