Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lorentz wrappers over instructions from Morley extension.
Synopsis
- stackRef :: forall (gn :: Nat) st n. (n ~ ToPeano gn, SingI n, KnownPeano n, RequireLongerThan st n) => PrintComment st
- printComment :: PrintComment (ToTs s) -> s :-> s
- testAssert :: (Typeable (ToTs out), HasCallStack) => Text -> PrintComment (ToTs inp) -> (inp :-> (Bool ': out)) -> inp :-> inp
- stackType :: forall s. s :-> s
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 _ _]