Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lorentz wrappers over instructions from Morley extension.
Synopsis
- stackRef :: forall (gn :: Nat) st n. (n ~ ToPeano gn, SingI n, RequireLongerThan st n) => PrintComment st
- printComment :: PrintComment (ToTs s) -> s :-> s
- justComment :: Text -> s :-> s
- comment :: CommentType -> s :-> s
- commentAroundFun :: Text -> (i :-> o) -> i :-> o
- commentAroundStmt :: Text -> (i :-> o) -> i :-> o
- testAssert :: 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, RequireLongerThan st n) => PrintComment st Source #
Include a value at given position on stack into comment produced
by printComment
.
stackRef @0
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
justComment :: Text -> s :-> s Source #
testAssert :: 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 _ _]