Safe Haskell | None |
---|---|
Language | Haskell2010 |
Backend machinery for cases.
Synopsis
- caseRec :: forall dt inp ret clauses. CaseCommon dt ret clauses => Expr dt -> clauses -> RetVars ret -> IndigoState inp (RetOutStack ret ++ inp)
- entryCaseRec :: forall dt entrypointKind inp ret clauses. (CaseCommon dt ret clauses, DocumentEntrypoints entrypointKind dt) => Proxy entrypointKind -> Expr dt -> clauses -> RetVars ret -> IndigoState inp (RetOutStack ret ++ inp)
- entryCaseSimpleRec :: forall dt inp ret clauses. (CaseCommon dt ret clauses, DocumentEntrypoints PlainEntrypointsKind dt, NiceParameterFull dt, RequireFlatParamEps dt) => Expr dt -> clauses -> RetVars ret -> IndigoState inp (RetOutStack ret ++ inp)
- data IndigoCaseClauseL ret (param :: CaseClauseParam)
- data IndigoClause x ret where
- IndigoClause :: (KnownValue x, ScopeCodeGen retBr, ret ~ RetExprs retBr, RetOutStack ret ~ RetOutStack retBr) => Var x -> (forall inp. SomeIndigoState (x ': inp)) -> retBr -> IndigoClause x ret
- type CaseCommonF f dt ret clauses = (InstrCaseC dt, RMap (CaseClauses dt), clauses ~ Rec (f ret) (CaseClauses dt), ScopeCodeGen ret)
Documentation
:: forall dt inp ret clauses. CaseCommon dt ret clauses | |
=> Expr dt | |
-> clauses | |
-> RetVars ret | Variable(s) that will be assigned to the resulting value(s) |
-> IndigoState inp (RetOutStack ret ++ inp) |
A case statement for indigo. See examples for a sample usage.
:: forall dt entrypointKind inp ret clauses. (CaseCommon dt ret clauses, DocumentEntrypoints entrypointKind dt) | |
=> Proxy entrypointKind | |
-> Expr dt | |
-> clauses | |
-> RetVars ret | Variable(s) that will be assigned to the resulting value(s) |
-> IndigoState inp (RetOutStack ret ++ inp) |
case_
for pattern-matching on parameter.
:: forall dt inp ret clauses. (CaseCommon dt ret clauses, DocumentEntrypoints PlainEntrypointsKind dt, NiceParameterFull dt, RequireFlatParamEps dt) | |
=> Expr dt | |
-> clauses | |
-> RetVars ret | Variable(s) that will be assigned to the resulting value(s) |
-> IndigoState inp (RetOutStack ret ++ inp) |
entryCase_
for contracts with flat parameter.
data IndigoCaseClauseL ret (param :: CaseClauseParam) Source #
This type is analogous to the CaseClauseL
type but instead of wrapping a Lorentz
instruction, this wraps an Indigo value with the same input/output types.
Instances
(name ~ AppendSymbol "c" ctor, KnownValue x) => CaseArrow name (IndigoClause x ret) (IndigoCaseClauseL ret ('CaseClauseParam ctor ('OneField x))) Source # | |
Defined in Indigo.Backend.Case (/->) :: Label name -> IndigoClause x ret -> IndigoCaseClauseL ret ('CaseClauseParam ctor ('OneField x)) # |
data IndigoClause x ret where Source #
IndigoClause | |
|
Instances
(name ~ AppendSymbol "c" ctor, KnownValue x) => CaseArrow name (IndigoClause x ret) (IndigoCaseClauseL ret ('CaseClauseParam ctor ('OneField x))) Source # | |
Defined in Indigo.Backend.Case (/->) :: Label name -> IndigoClause x ret -> IndigoCaseClauseL ret ('CaseClauseParam ctor ('OneField x)) # |
type CaseCommonF f dt ret clauses = (InstrCaseC dt, RMap (CaseClauses dt), clauses ~ Rec (f ret) (CaseClauses dt), ScopeCodeGen ret) Source #
This constraint is shared by all case*
functions.
Including some outside this module.