Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Morley.Michelson.Untyped.Ext
Description
Morley extensions to the Michelson language
Synopsis
- data ExtInstrAbstract f op
- newtype StackRef = StackRef Natural
- newtype PrintComment = PrintComment {}
- data TestAssert f (op :: Type) = TestAssert {
- tassName :: Text
- tassComment :: PrintComment
- tassInstrs :: f op
- newtype Var = Var Text
- data TyVar
- data StackTypePattern
- varSet :: StackTypePattern -> Set Var
- stackTypePatternToList :: StackTypePattern -> ([TyVar], Bool)
Documentation
data ExtInstrAbstract f op Source #
Implementation-specific instructions embedded in a NOP
primitive, which
mark a specific point during a contract's typechecking or execution.
These instructions are not allowed to modify the contract's stack, but may impose additional constraints that can cause a contract to report errors in type-checking or testing.
Additionaly, some implementation-specific language features such as
type-checking of LetMacro
s are implemented using this mechanism
(specifically FN
and FN_END
).
Constructors
STACKTYPE StackTypePattern | Matches current stack against a type-pattern |
UTEST_ASSERT (TestAssert f op) | Copy the current stack and run an inline assertion on it |
UPRINT PrintComment | Print a comment with optional embedded |
UCOMMENT Text | A comment in Michelson code |
Instances
A reference into the stack.
Instances
FromJSON StackRef Source # | |
ToJSON StackRef Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
Data StackRef Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StackRef -> c StackRef # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StackRef # toConstr :: StackRef -> Constr # dataTypeOf :: StackRef -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c StackRef) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StackRef) # gmapT :: (forall b. Data b => b -> b) -> StackRef -> StackRef # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StackRef -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StackRef -> r # gmapQ :: (forall d. Data d => d -> u) -> StackRef -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> StackRef -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> StackRef -> m StackRef # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StackRef -> m StackRef # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StackRef -> m StackRef # | |
Generic StackRef Source # | |
Show StackRef Source # | |
NFData StackRef Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
Eq StackRef Source # | |
Buildable StackRef Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
type Rep StackRef Source # | |
Defined in Morley.Michelson.Untyped.Ext |
newtype PrintComment Source #
A comment with optional embedded StackRef
s. Used with PRINT
extended instruction.
Constructors
PrintComment | |
Fields |
Instances
data TestAssert f (op :: Type) Source #
An inline test assertion
Constructors
TestAssert | |
Fields
|
Instances
HoistInstr TestAssert Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods hoistInstr :: forall f (a :: k) g. (f a -> g a) -> TestAssert f a -> TestAssert g a Source # | |
Functor f => Functor (TestAssert f) Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods fmap :: (a -> b) -> TestAssert f a -> TestAssert f b # (<$) :: a -> TestAssert f b -> TestAssert f a # | |
FromJSON (f op) => FromJSON (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods parseJSON :: Value -> Parser (TestAssert f op) # parseJSONList :: Value -> Parser [TestAssert f op] # | |
ToJSON (f op) => ToJSON (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods toJSON :: TestAssert f op -> Value # toEncoding :: TestAssert f op -> Encoding # toJSONList :: [TestAssert f op] -> Value # toEncodingList :: [TestAssert f op] -> Encoding # | |
(Typeable f, Typeable op, Data (f op)) => Data (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TestAssert f op -> c (TestAssert f op) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (TestAssert f op) # toConstr :: TestAssert f op -> Constr # dataTypeOf :: TestAssert f op -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (TestAssert f op)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (TestAssert f op)) # gmapT :: (forall b. Data b => b -> b) -> TestAssert f op -> TestAssert f op # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TestAssert f op -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TestAssert f op -> r # gmapQ :: (forall d. Data d => d -> u) -> TestAssert f op -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TestAssert f op -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TestAssert f op -> m (TestAssert f op) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TestAssert f op -> m (TestAssert f op) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TestAssert f op -> m (TestAssert f op) # | |
Generic (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext Associated Types type Rep (TestAssert f op) :: Type -> Type # Methods from :: TestAssert f op -> Rep (TestAssert f op) x # to :: Rep (TestAssert f op) x -> TestAssert f op # | |
Show (f op) => Show (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods showsPrec :: Int -> TestAssert f op -> ShowS # show :: TestAssert f op -> String # showList :: [TestAssert f op] -> ShowS # | |
NFData (f op) => NFData (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods rnf :: TestAssert f op -> () # | |
Eq (f op) => Eq (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods (==) :: TestAssert f op -> TestAssert f op -> Bool # (/=) :: TestAssert f op -> TestAssert f op -> Bool # | |
(Foldable f, Buildable op) => Buildable (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
type Rep (TestAssert f op) Source # | |
Defined in Morley.Michelson.Untyped.Ext type Rep (TestAssert f op) = D1 ('MetaData "TestAssert" "Morley.Michelson.Untyped.Ext" "morley-1.20.0-inplace" 'False) (C1 ('MetaCons "TestAssert" 'PrefixI 'True) (S1 ('MetaSel ('Just "tassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "tassComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PrintComment) :*: S1 ('MetaSel ('Just "tassInstrs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (f op))))) |
A (named) type variable
Instances
FromJSON Var Source # | |
ToJSON Var Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
Data Var Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var -> c Var # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Var # dataTypeOf :: Var -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Var) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Var) # gmapT :: (forall b. Data b => b -> b) -> Var -> Var # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQ :: (forall d. Data d => d -> u) -> Var -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Var -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # | |
Generic Var Source # | |
Show Var Source # | |
NFData Var Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
Eq Var Source # | |
Ord Var Source # | |
Buildable Var Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
type Rep Var Source # | |
Defined in Morley.Michelson.Untyped.Ext |
A type-variable or a type-constant
Instances
FromJSON TyVar Source # | |
ToJSON TyVar Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
Data TyVar Source # | |
Defined in Morley.Michelson.Untyped.Ext Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TyVar -> c TyVar # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TyVar # dataTypeOf :: TyVar -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TyVar) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyVar) # gmapT :: (forall b. Data b => b -> b) -> TyVar -> TyVar # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyVar -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyVar -> r # gmapQ :: (forall d. Data d => d -> u) -> TyVar -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TyVar -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TyVar -> m TyVar # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TyVar -> m TyVar # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TyVar -> m TyVar # | |
Generic TyVar Source # | |
Show TyVar Source # | |
NFData TyVar Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
Eq TyVar Source # | |
Buildable TyVar Source # | |
Defined in Morley.Michelson.Untyped.Ext | |
type Rep TyVar Source # | |
Defined in Morley.Michelson.Untyped.Ext type Rep TyVar = D1 ('MetaData "TyVar" "Morley.Michelson.Untyped.Ext" "morley-1.20.0-inplace" 'False) (C1 ('MetaCons "VarID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Var)) :+: C1 ('MetaCons "TyCon" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty))) |
data StackTypePattern Source #
A stack pattern-match
Constructors
StkEmpty | |
StkRest | |
StkCons TyVar StackTypePattern |
Instances
stackTypePatternToList :: StackTypePattern -> ([TyVar], Bool) Source #
Convert StackTypePattern
to a list of types. Also returns
Bool
which is True
if the pattern is a fixed list of types and
False
if it's a pattern match on the head of the stack.