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

Morley.Michelson.Untyped.Type

Description

Michelson types represented in untyped model.

Synopsis

Documentation

data Ty Source #

Annotated Michelson type. We don't name it Type to avoid conflicts with Type.

Constructors

Ty ~T TypeAnn 

Instances

Instances details
FromJSON Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

ToJSON Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Data Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

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 #

toConstr :: Ty -> Constr #

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 # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Associated Types

type Rep Ty :: Type -> Type #

Methods

from :: Ty -> Rep Ty x #

to :: Rep Ty x -> Ty #

Show Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

showsPrec :: Int -> Ty -> ShowS #

show :: Ty -> String #

showList :: [Ty] -> ShowS #

NFData Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

rnf :: Ty -> () #

Eq Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

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

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

ToExpression Ty Source # 
Instance details

Defined in Morley.Micheline.Class

RenderDoc Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

HasCLReader Ty Source # 
Instance details

Defined in Morley.CLI

FromExp x Ty Source # 
Instance details

Defined in Morley.Micheline.Class

Methods

fromExp :: Exp x -> Either (FromExpError x) Ty Source #

Lift Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

lift :: Quote m => Ty -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Ty -> Code m Ty #

Buildable (MismatchError Ty) Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

build :: MismatchError Ty -> Doc

buildList :: [MismatchError Ty] -> Doc

type Rep Ty Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

type Rep Ty = D1 ('MetaData "Ty" "Morley.Michelson.Untyped.Type" "morley-1.20.0-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)))

data T Source #

Michelson Type

Instances

Instances details
FromJSON T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

ToJSON T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Data T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> T -> c T #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c T #

toConstr :: T -> Constr #

dataTypeOf :: T -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c T) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c T) #

gmapT :: (forall b. Data b => b -> b) -> T -> T #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> T -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> T -> r #

gmapQ :: (forall d. Data d => d -> u) -> T -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> T -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> T -> m T #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> T -> m T #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> T -> m T #

Generic T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Associated Types

type Rep T :: Type -> Type #

Methods

from :: T -> Rep T x #

to :: Rep T x -> T #

Show T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

showsPrec :: Int -> T -> ShowS #

show :: T -> String #

showList :: [T] -> ShowS #

NFData T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

rnf :: T -> () #

Eq T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

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

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

ToExpression T Source # 
Instance details

Defined in Morley.Micheline.Class

RenderDoc T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

FromExp x T Source # 
Instance details

Defined in Morley.Micheline.Class

Methods

fromExp :: Exp x -> Either (FromExpError x) T Source #

Lift T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

lift :: Quote m => T -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => T -> Code m T #

type Rep T Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

type Rep T = D1 ('MetaData "T" "Morley.Michelson.Untyped.Type" "morley-1.20.0-inplace" 'False) (((((C1 ('MetaCons "TKey" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TUnit" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TSignature" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TChainId" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "TOption" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty)) :+: C1 ('MetaCons "TList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty))) :+: (C1 ('MetaCons "TSet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty)) :+: C1 ('MetaCons "TOperation" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "TContract" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty)) :+: C1 ('MetaCons "TTicket" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty))) :+: (C1 ('MetaCons "TPair" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FieldAnn) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FieldAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty)))) :+: C1 ('MetaCons "TOr" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FieldAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FieldAnn)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty))))) :+: ((C1 ('MetaCons "TLambda" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty)) :+: C1 ('MetaCons "TMap" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty))) :+: (C1 ('MetaCons "TBigMap" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty)) :+: C1 ('MetaCons "TInt" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: ((((C1 ('MetaCons "TNat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TString" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TBytes" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TMutez" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "TBool" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TKeyHash" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TBls12381Fr" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TBls12381G1" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "TBls12381G2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TTimestamp" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TAddress" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TChest" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "TChestKey" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TSaplingState" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural))) :+: (C1 ('MetaCons "TSaplingTransaction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural)) :+: C1 ('MetaCons "TNever" 'PrefixI 'False) (U1 :: Type -> Type))))))

data ParameterType Source #

Since Babylon parameter type can have special root annotation.

Constructors

ParameterType Ty RootAnn 

Instances

Instances details
FromJSON ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

ToJSON ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Data ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ParameterType -> c ParameterType #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ParameterType #

toConstr :: ParameterType -> Constr #

dataTypeOf :: ParameterType -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ParameterType) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ParameterType) #

gmapT :: (forall b. Data b => b -> b) -> ParameterType -> ParameterType #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ParameterType -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ParameterType -> r #

gmapQ :: (forall d. Data d => d -> u) -> ParameterType -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ParameterType -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ParameterType -> m ParameterType #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ParameterType -> m ParameterType #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ParameterType -> m ParameterType #

Generic ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Associated Types

type Rep ParameterType :: Type -> Type #

Show ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

NFData ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

rnf :: ParameterType -> () #

Eq ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

RenderDoc ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Lift ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

Methods

lift :: Quote m => ParameterType -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => ParameterType -> Code m ParameterType #

type Rep ParameterType Source # 
Instance details

Defined in Morley.Michelson.Untyped.Type

type Rep ParameterType = D1 ('MetaData "ParameterType" "Morley.Michelson.Untyped.Type" "morley-1.20.0-inplace" 'False) (C1 ('MetaCons "ParameterType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RootAnn)))

toption :: Ty -> T Source #

Construct non-annotated option type from an annotated type

tpair :: Ty -> Ty -> T Source #

Construct non-annotated pair type from two annotated types

tor :: Ty -> Ty -> T Source #

Construct non-annotated or type from two annotated types

tyint :: Ty Source #

Construct annotated int type with an empty annotation

tynat :: Ty Source #

Construct annotated nat type with an empty annotation

tyunit :: Ty Source #

Construct annotated unit type with an empty annotation

tybool :: Ty Source #

Construct annotated bool type with an empty annotation

typair :: Ty -> Ty -> Ty Source #

Construct annotated pair type with an empty annotation

tyor :: Ty -> Ty -> Ty Source #

Construct annotated or type with an empty annotation

tyImplicitAccountParam :: Ty Source #

For implicit account, which Ty its parameter seems to have from outside.

isAtomicType :: Ty -> Bool Source #

Check if type is atomic.

isKey :: Ty -> Bool Source #

Predicate checking if type is key

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.

isMutez :: Ty -> Bool Source #

Predicate checking if type is mutez

isKeyHash :: Ty -> Bool Source #

Predicate checking if type is keyhash

isBool :: Ty -> Bool Source #

Predicate checking if type is bool

isString :: Ty -> Bool Source #

Predicate checking if type is string

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

isNat :: Ty -> Bool Source #

Predicate checking if type is nat

isInt :: Ty -> Bool Source #

Predicate checking if type is int

isBytes :: Ty -> Bool Source #

Predicate checking if type is bytes

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

unwrapT :: Ty -> T Source #

Extract a raw Michelson type from an annotated one