Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module implements the ability to put Indigo computations on the stack as a lambda and execute them.
Synopsis
- type LambdaPure1 arg res = Lambda1Generic '[] arg res
- createLambdaPure1 :: forall res arg inp out. CreateLambdaPure1C arg res => LambdaCreator '[] arg res inp out
- type CreateLambdaPure1C arg res = CreateLambda1CGeneric '[] arg res
- executeLambdaPure1 :: forall res arg inp. ExecuteLambdaPure1C arg res => LambdaExecutor '[] arg res inp
- type ExecuteLambdaPure1C arg res = ExecuteLambda1CGeneric '[] arg res
- initMetaDataPure :: KnownValue arg => (Var arg, MetaData '[arg])
- type Lambda1 st arg res = Lambda1Generic '[st] arg res
- createLambda1 :: forall st res arg inp out. CreateLambda1C st arg res => LambdaCreator '[st] arg res inp out
- type CreateLambda1C st arg res = (KnownValue st, CreateLambda1CGeneric '[st] arg res)
- executeLambda1 :: forall st res arg inp. ExecuteLambda1C st arg res => LambdaExecutor '[st] arg res inp
- type ExecuteLambda1C st arg res = (IsObject st, HasStorage st, ExecuteLambda1CGeneric '[st] arg res)
- initMetaData :: (KnownValue arg, KnownValue st) => (Var arg, MetaData '[arg, st])
- type LambdaEff1 st arg res = Lambda1Generic '[st, Ops] arg res
- createLambdaEff1 :: forall st res arg inp out. CreateLambdaEff1C st arg res => LambdaCreator '[st, Ops] arg res inp out
- type CreateLambdaEff1C st arg res = (KnownValue st, CreateLambda1CGeneric '[st, Ops] arg res)
- executeLambdaEff1 :: forall st res arg inp. ExecuteLambdaEff1C st arg res => LambdaExecutor '[st, Ops] arg res inp
- type ExecuteLambdaEff1C st arg res = (HasStorage st, HasSideEffects, IsObject st, ExecuteLambda1CGeneric '[st, Ops] arg res)
- initMetaDataEff :: (KnownValue arg, KnownValue st) => (Var arg, MetaData '[arg, st, Ops])
- type Lambda1Generic extra arg res = (arg & extra) :-> (RetOutStack res ++ extra)
- type LambdaExecutor extra arg res inp = Var (Lambda1Generic extra arg res) -> Expr arg -> IndigoState inp (RetOutStack res ++ inp) (RetVars res)
- type LambdaCreator extra arg res inp out = (Var arg -> IndigoState (arg & extra) out res) -> IndigoState inp (Lambda1Generic extra arg res & inp) (Var (Lambda1Generic extra arg res))
Documentation
type LambdaPure1 arg res = Lambda1Generic '[] arg res Source #
createLambdaPure1 :: forall res arg inp out. CreateLambdaPure1C arg res => LambdaCreator '[] arg res inp out Source #
Create a lambda, that takes only one argument, from the given computation. The lambda is not allowed to modify storage and emit operations.
type CreateLambdaPure1C arg res = CreateLambda1CGeneric '[] arg res Source #
executeLambdaPure1 :: forall res arg inp. ExecuteLambdaPure1C arg res => LambdaExecutor '[] arg res inp Source #
Execute a lambda, which accepts only one argument, on passed expression.
type ExecuteLambdaPure1C arg res = ExecuteLambda1CGeneric '[] arg res Source #
initMetaDataPure :: KnownValue arg => (Var arg, MetaData '[arg]) Source #
type Lambda1 st arg res = Lambda1Generic '[st] arg res Source #
createLambda1 :: forall st res arg inp out. CreateLambda1C st arg res => LambdaCreator '[st] arg res inp out Source #
Create a lambda, that takes only one argument, from the given computation. The lambda is not allowed to emit operations.
type CreateLambda1C st arg res = (KnownValue st, CreateLambda1CGeneric '[st] arg res) Source #
executeLambda1 :: forall st res arg inp. ExecuteLambda1C st arg res => LambdaExecutor '[st] arg res inp Source #
Execute a lambda that accepts only one argument on the given expression.
type ExecuteLambda1C st arg res = (IsObject st, HasStorage st, ExecuteLambda1CGeneric '[st] arg res) Source #
initMetaData :: (KnownValue arg, KnownValue st) => (Var arg, MetaData '[arg, st]) Source #
type LambdaEff1 st arg res = Lambda1Generic '[st, Ops] arg res Source #
createLambdaEff1 :: forall st res arg inp out. CreateLambdaEff1C st arg res => LambdaCreator '[st, Ops] arg res inp out Source #
Create a lambda, that takes only one argument, from the given computation, and return a variable referring to this lambda. The lambda is allowed to modify storage and emit operations.
type CreateLambdaEff1C st arg res = (KnownValue st, CreateLambda1CGeneric '[st, Ops] arg res) Source #
executeLambdaEff1 :: forall st res arg inp. ExecuteLambdaEff1C st arg res => LambdaExecutor '[st, Ops] arg res inp Source #
Execute a lambda that accepts only one argument on the given expression. Also updates the storage and operations with the values returned from the lambda.
type ExecuteLambdaEff1C st arg res = (HasStorage st, HasSideEffects, IsObject st, ExecuteLambda1CGeneric '[st, Ops] arg res) Source #
initMetaDataEff :: (KnownValue arg, KnownValue st) => (Var arg, MetaData '[arg, st, Ops]) Source #
type Lambda1Generic extra arg res = (arg & extra) :-> (RetOutStack res ++ extra) Source #
type LambdaExecutor extra arg res inp = Var (Lambda1Generic extra arg res) -> Expr arg -> IndigoState inp (RetOutStack res ++ inp) (RetVars res) Source #
type LambdaCreator extra arg res inp out = (Var arg -> IndigoState (arg & extra) out res) -> IndigoState inp (Lambda1Generic extra arg res & inp) (Var (Lambda1Generic extra arg res)) Source #