indigo-0.2.2: Convenient imperative eDSL over Lorentz.
Safe HaskellNone
LanguageHaskell2010

Indigo.Backend.Case

Description

High level statements of Indigo language.

Synopsis

Documentation

caseRec :: forall dt inp ret clauses. CaseCommon dt ret clauses => Expr dt -> clauses -> IndigoState inp (RetOutStack ret ++ inp) (RetVars ret) Source #

A case statement for indigo. See examples for a sample usage.

entryCaseRec :: forall dt entrypointKind inp ret clauses. (CaseCommon dt ret clauses, DocumentEntrypoints entrypointKind dt) => Proxy entrypointKind -> Expr dt -> clauses -> IndigoState inp (RetOutStack ret ++ inp) (RetVars ret) Source #

case_ for pattern-matching on parameter.

entryCaseSimpleRec :: forall cp inp ret clauses. (CaseCommon cp ret clauses, DocumentEntrypoints PlainEntrypointsKind cp, NiceParameterFull cp, RequireFlatParamEps cp) => Expr cp -> clauses -> IndigoState inp (RetOutStack ret ++ inp) (RetVars ret) Source #

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

Instances details
(name ~ AppendSymbol "c" ctor, KnownValue x) => CaseArrow name (Var x -> IndigoAnyOut x ret) (IndigoCaseClauseL ret ('CaseClauseParam ctor ('OneField x))) Source # 
Instance details

Defined in Indigo.Backend.Case

Methods

(/->) :: Label name -> (Var x -> IndigoAnyOut 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 #

type CaseCommon dt ret clauses = CaseCommonF IndigoCaseClauseL dt ret clauses Source #

data IndigoAnyOut x ret Source #

Constructors

forall retBranch.(ScopeCodeGen retBranch, RetOutStack ret ~ RetOutStack retBranch) => IndigoAnyOut (forall inp. SomeIndigoState (x ': inp) retBranch) 

Instances

Instances details
(name ~ AppendSymbol "c" ctor, KnownValue x) => CaseArrow name (Var x -> IndigoAnyOut x ret) (IndigoCaseClauseL ret ('CaseClauseParam ctor ('OneField x))) Source # 
Instance details

Defined in Indigo.Backend.Case

Methods

(/->) :: Label name -> (Var x -> IndigoAnyOut x ret) -> IndigoCaseClauseL ret ('CaseClauseParam ctor ('OneField x)) #