lorentz-0.11.0: EDSL for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Lorentz.Ext

Description

Lorentz wrappers over instructions from Morley extension.

Synopsis

Documentation

stackRef :: forall (gn :: Nat) st n. (n ~ ToPeano gn, SingI n, KnownPeano n, RequireLongerThan st n) => PrintComment st Source #

Include a value at given position on stack into comment produced by printComment.

>>> stackRef @0
<includes the top of the stack>

printComment :: PrintComment (ToTs s) -> s :-> s Source #

Print a comment. It will be visible in tests.

>>> printComment "Hello world!"
>>> printComment $ "On top of the stack I see " <> stackRef @0

testAssert :: (Typeable (ToTs out), HasCallStack) => Text -> PrintComment (ToTs inp) -> (inp :-> (Bool ': out)) -> inp :-> inp Source #

Test an invariant, fail if it does not hold.

This won't be included into production contract and is executed only in tests.

stackType :: forall s. s :-> s Source #

Fix the current type of the stack to be given one.

>>> stackType @'[Natural]
>>> stackType @(Integer : Natural : s)
>>> stackType @'["balance" :! Integer, "toSpend" :! Integer, BigMap Address Integer]

Note that you can omit arbitrary parts of the type.

>>> stackType @'["balance" :! Integer, "toSpend" :! _, BigMap _ _]