Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Running Lorentz code easily.
For testing and demonstration purposes.
Synopsis
- (-$?) :: (ZipInstr inps, IsoValue out) => (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out
- (-$) :: (ZipInstr inps, IsoValue out, HasCallStack) => (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out
- (&?-) :: (ZipInstr inps, IsoValue out) => ZippedStack inps -> (IsNotInView => inps :-> '[out]) -> Either (MichelsonFailureWithStack Void) out
- (&-) :: (ZipInstr inps, IsoValue out, HasCallStack) => ZippedStack inps -> (IsNotInView => inps :-> '[out]) -> out
- (<-$>) :: (ZipInstr inps, IsoValue out, HasCallStack) => (inps :-> '[out]) -> [ZippedStack inps] -> [out]
- data ZippedStackRepr a b = a ::: b
- data ZSNil = ZSNil
Documentation
(-$?) :: (ZipInstr inps, IsoValue out) => (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out infixr 2 Source #
Run a lambda with given input.
Note that this always returns one value, but can accept multiple input values (in such case they are grouped into nested pairs).
For testing and demonstration purposes.
(-$) :: (ZipInstr inps, IsoValue out, HasCallStack) => (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out infixr 2 Source #
Like
, assumes that no failure is possible.-$?
For testing and demonstration purposes. Note, that we specify the result type of polymorphic operations to avoid ambiguity arising from polymorphic literals.
Use ZippedStackRepr
to represent stack of two or more elements, and ZSNil
for empty stacks.
Stacks of one element are represented by the element itself.
>>>
nop -$ 5
5>>>
sub -$ 3 ::: 2 :: Integer
1>>>
push 9 -$ ZSNil
9>>>
add # add -$ 1 ::: 2 ::: 3 :: Integer
6
(&?-) :: (ZipInstr inps, IsoValue out) => ZippedStack inps -> (IsNotInView => inps :-> '[out]) -> Either (MichelsonFailureWithStack Void) out infixl 2 Source #
Version of (-$?) with arguments flipped.
(&-) :: (ZipInstr inps, IsoValue out, HasCallStack) => ZippedStack inps -> (IsNotInView => inps :-> '[out]) -> out infixl 2 Source #
Version of (-$) with arguments flipped.
(<-$>) :: (ZipInstr inps, IsoValue out, HasCallStack) => (inps :-> '[out]) -> [ZippedStack inps] -> [out] infixl 2 Source #
Version of (-$) applicable to a series of values.
data ZippedStackRepr a b Source #
A type used to represent a zipped stack of at least two elements, isomorphic to a pair and represented as such in Michelson.
a ::: b infixr 5 |
Instances
A type used to represent an empty zipped stack, isomorphic to a unit and represented as such in Michelson.
Instances
Generic ZSNil Source # | |
Show ZSNil Source # | |
Buildable ZSNil Source # | |
Defined in Lorentz.Zip | |
Eq ZSNil Source # | |
HasAnnotation ZSNil Source # | |
Defined in Lorentz.Zip getAnnotation :: FollowEntrypointFlag -> Notes (ToT ZSNil) Source # | |
IsoValue ZSNil Source # | |
type Rep ZSNil Source # | |
type ToT ZSNil Source # | |
Defined in Lorentz.Zip |