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

Indigo.Backend.Case

Description

High level statements of Indigo language.

Synopsis

Documentation

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

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

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

case_ for pattern-matching on parameter.

entryCaseSimpleRec :: forall cp guard inp ret clauses. (CaseCommon cp guard ret clauses, DocumentEntrypoints PlainEntrypointsKind cp, NiceParameterFull cp, RequireFlatParamEps cp) => guard -> 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 guard ret clauses = (guard :~> dt, InstrCaseC dt, RMap (CaseClauses dt), clauses ~ Rec (f ret) (CaseClauses dt), ScopeCodeGen ret) Source #

type CaseCommon dt guard ret clauses = CaseCommonF IndigoCaseClauseL dt guard 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)) #