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

Morley.Michelson.Macro

Synopsis

Macros types

data CadrStruct Source #

Constructors

A 
D 

Instances

Instances details
FromJSON CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

ToJSON CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Data CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

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

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

toConstr :: CadrStruct -> Constr #

dataTypeOf :: CadrStruct -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Associated Types

type Rep CadrStruct :: Type -> Type #

Show CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

NFData CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

rnf :: CadrStruct -> () #

Buildable CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

build :: CadrStruct -> Builder #

Eq CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

type Rep CadrStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

type Rep CadrStruct = D1 ('MetaData "CadrStruct" "Morley.Michelson.Macro" "morley-1.19.1-inplace" 'False) (C1 ('MetaCons "A" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "D" 'PrefixI 'False) (U1 :: Type -> Type))

data PairStruct Source #

Instances

Instances details
FromJSON PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

ToJSON PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Data PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

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

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

toConstr :: PairStruct -> Constr #

dataTypeOf :: PairStruct -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Associated Types

type Rep PairStruct :: Type -> Type #

Show PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

NFData PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

rnf :: PairStruct -> () #

Buildable PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

build :: PairStruct -> Builder #

Eq PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

type Rep PairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

data UnpairStruct Source #

Instances

Instances details
FromJSON UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

ToJSON UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Data UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

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

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

toConstr :: UnpairStruct -> Constr #

dataTypeOf :: UnpairStruct -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Associated Types

type Rep UnpairStruct :: Type -> Type #

Show UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

NFData UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

rnf :: UnpairStruct -> () #

Buildable UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

Eq UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

type Rep UnpairStruct Source # 
Instance details

Defined in Morley.Michelson.Macro

data Macro Source #

Built-in Michelson Macros defined by the specification

Instances

Instances details
FromJSON Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

ToJSON Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

Data Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

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

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

toConstr :: Macro -> Constr #

dataTypeOf :: Macro -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

Associated Types

type Rep Macro :: Type -> Type #

Methods

from :: Macro -> Rep Macro x #

to :: Rep Macro x -> Macro #

Show Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

showsPrec :: Int -> Macro -> ShowS #

show :: Macro -> String #

showList :: [Macro] -> ShowS #

NFData Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

rnf :: Macro -> () #

Buildable Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

build :: Macro -> Builder #

Eq Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

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

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

type Rep Macro Source # 
Instance details

Defined in Morley.Michelson.Macro

type Rep Macro = D1 ('MetaData "Macro" "Morley.Michelson.Macro" "morley-1.19.1-inplace" 'False) ((((C1 ('MetaCons "CMP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParsedInstr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn)) :+: C1 ('MetaCons "IFX" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParsedInstr) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp])))) :+: (C1 ('MetaCons "IFCMP" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParsedInstr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp]))) :+: (C1 ('MetaCons "FAIL" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PAPAIR" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PairStruct) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TypeAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn)))))) :+: ((C1 ('MetaCons "UNPAPAIR" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UnpairStruct)) :+: (C1 ('MetaCons "CADR" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CadrStruct]) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FieldAnn))) :+: C1 ('MetaCons "CARN" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word)))) :+: (C1 ('MetaCons "CDRN" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word)) :+: (C1 ('MetaCons "SET_CADR" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CadrStruct]) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FieldAnn))) :+: C1 ('MetaCons "MAP_CADR" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CadrStruct]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FieldAnn) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp]))))))) :+: (((C1 ('MetaCons "DIIP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp])) :+: C1 ('MetaCons "DUUP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VarAnn))) :+: (C1 ('MetaCons "ASSERT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ASSERTX" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParsedInstr)) :+: C1 ('MetaCons "ASSERT_CMP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ParsedInstr))))) :+: ((C1 ('MetaCons "ASSERT_NONE" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ASSERT_SOME" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ASSERT_LEFT" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ASSERT_RIGHT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IF_SOME" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp])) :+: C1 ('MetaCons "IF_RIGHT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ParsedOp])))))))

Morley Parsed value types

Morley Parsed instruction types

data ParsedOp Source #

Unexpanded instructions produced directly by the ops parser, which contains primitive Michelson Instructions, inline-able macros and sequences

Constructors

Prim ParsedInstr SrcPos

Primitive Michelson instruction

Mac Macro SrcPos

Built-in Michelson macro defined by the specification

Seq [ParsedOp] SrcPos

A sequence of instructions

Instances

Instances details
FromJSON ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

ToJSON ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

Data ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

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

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

toConstr :: ParsedOp -> Constr #

dataTypeOf :: ParsedOp -> DataType #

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

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

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

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

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

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

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

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

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

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

Generic ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

Associated Types

type Rep ParsedOp :: Type -> Type #

Methods

from :: ParsedOp -> Rep ParsedOp x #

to :: Rep ParsedOp x -> ParsedOp #

Show ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

NFData ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

rnf :: ParsedOp -> () #

Buildable ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

Methods

build :: ParsedOp -> Builder #

Eq ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

RenderDoc ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

type Rep ParsedOp Source # 
Instance details

Defined in Morley.Michelson.Macro

For utilities

expandContract :: Contract' ParsedOp -> Contract Source #

Expand all macros in parsed contract.

expandValue :: ParsedValue -> Value Source #

Expand all macros in parsed value.

For parsing

Internals exported for tests

expandList :: [ParsedOp] -> [ExpandedOp] Source #

Deprecated: Use 'map expand' instead

expandPapair :: ErrorSrcPos -> PairStruct -> TypeAnn -> VarAnn -> [ExpandedOp] Source #

The macro expansion rules below were taken from: https://tezos.gitlab.io/active/michelson.html#syntactic-conveniences

The correctness of type-annotation expansion is currently untested, as these expansions are not explicitly documented in the Michelson Specification.