module Lorentz.Run.Simple
( (-$?)
, (-$)
, (&?-)
, (&-)
, (<-$>)
, ZippedStackRepr(..)
, ZSNil(..)
) where
import Lorentz.Base
import Lorentz.Run
import Lorentz.Value
import Lorentz.Zip
import Morley.Michelson.Interpret
import Morley.Michelson.Runtime.Dummy (dummyContractEnv)
infixr 2 -$?
(-$?) :: (ZipInstr inps, IsoValue out)
=> (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out
IsNotInView => inps :-> '[out]
code -$? :: forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out) =>
(IsNotInView => inps :-> '[out])
-> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out
-$? ZippedStack inps
inp = ContractEnv
-> (IsNotInView => Fn (ZippedStack inps) out)
-> ZippedStack inps
-> Either (MichelsonFailureWithStack Void) out
forall inp out.
(IsoValue inp, IsoValue out) =>
ContractEnv
-> (IsNotInView => Fn inp out)
-> inp
-> Either (MichelsonFailureWithStack Void) out
interpretLorentzLambda ContractEnv
forall (m :: * -> *). Applicative m => ContractEnv' m
dummyContractEnv ('[ZippedStack inps] :-> inps
forall (s :: [*]). ZipInstr s => '[ZippedStack s] :-> s
unzipInstr ('[ZippedStack inps] :-> inps)
-> (inps :-> '[out]) -> Fn (ZippedStack inps) out
forall (a :: [*]) (b :: [*]) (c :: [*]).
(a :-> b) -> (b :-> c) -> a :-> c
# inps :-> '[out]
IsNotInView => inps :-> '[out]
code) ZippedStack inps
inp
infixr 2 -$
(-$) :: (ZipInstr inps, IsoValue out, HasCallStack)
=> (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out
IsNotInView => inps :-> '[out]
code -$ :: forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out, HasCallStack) =>
(IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out
-$ ZippedStack inps
inp = Either (MichelsonFailureWithStack Void) out -> out
forall a b. (HasCallStack, Buildable a) => Either a b -> b
unsafe (Either (MichelsonFailureWithStack Void) out -> out)
-> Either (MichelsonFailureWithStack Void) out -> out
forall a b. (a -> b) -> a -> b
$ inps :-> '[out]
IsNotInView => inps :-> '[out]
code (IsNotInView => inps :-> '[out])
-> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out
forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out) =>
(IsNotInView => inps :-> '[out])
-> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out
-$? ZippedStack inps
inp
infixl 2 &?-
(&?-) :: (ZipInstr inps, IsoValue out)
=> ZippedStack inps -> (IsNotInView => inps :-> '[out]) -> Either (MichelsonFailureWithStack Void) out
&?- :: forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out) =>
ZippedStack inps
-> (IsNotInView => inps :-> '[out])
-> Either (MichelsonFailureWithStack Void) out
(&?-) ZippedStack inps
x IsNotInView => inps :-> '[out]
y = (IsNotInView => inps :-> '[out])
-> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out
forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out) =>
(IsNotInView => inps :-> '[out])
-> ZippedStack inps -> Either (MichelsonFailureWithStack Void) out
(-$?) inps :-> '[out]
IsNotInView => inps :-> '[out]
y ZippedStack inps
x
infixl 2 &-
(&-) :: (ZipInstr inps, IsoValue out, HasCallStack)
=> ZippedStack inps -> (IsNotInView => inps :-> '[out]) -> out
&- :: forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out, HasCallStack) =>
ZippedStack inps -> (IsNotInView => inps :-> '[out]) -> out
(&-) ZippedStack inps
x IsNotInView => inps :-> '[out]
y = (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out
forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out, HasCallStack) =>
(IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out
(-$) inps :-> '[out]
IsNotInView => inps :-> '[out]
y ZippedStack inps
x
infixl 2 <-$>
(<-$>) :: (ZipInstr inps, IsoValue out, HasCallStack)
=> (inps :-> '[out]) -> [ZippedStack inps] -> [out]
inps :-> '[out]
code <-$> :: forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out, HasCallStack) =>
(inps :-> '[out]) -> [ZippedStack inps] -> [out]
<-$> [ZippedStack inps]
inps = (ZippedStack inps -> out) -> [ZippedStack inps] -> [out]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
map (inps :-> '[out]
IsNotInView => inps :-> '[out]
code (IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out
forall (inps :: [*]) out.
(ZipInstr inps, IsoValue out, HasCallStack) =>
(IsNotInView => inps :-> '[out]) -> ZippedStack inps -> out
-$) [ZippedStack inps]
inps