plutus-core-1.49.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Builtin.Case

Synopsis

Documentation

class AnnotateCaseBuiltin uni where Source #

Methods

annotateCaseBuiltinUniOf term ~ uni ⇒ Type TyName uni ann → [term] → Either Text [(term, [Type TyName uni ann])] Source #

Given a tag for a built-in type and a list of branches, annotate each of the branches with its expected argument types or fail if casing on values of the built-in type isn't supported. Note: you don't need to include the resulting type of the whole case matching in the returning list here.

Instances

Instances details
AnnotateCaseBuiltin DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

annotateCaseBuiltinUniOf term ~ DefaultUniType TyName DefaultUni ann → [term] → Either Text [(term, [Type TyName DefaultUni ann])] Source #

class CaseBuiltin uni where Source #

Methods

caseBuiltinUniOf term ~ uni ⇒ Some (ValueOf uni) → Vector term → Either Text (HeadSpine term (Some (ValueOf uni))) Source #

Given a constant with its type tag and a vector of branches, choose the appropriate branch or fail if the constant doesn't correspond to any of the branches (or casing on constants of this type isn't supported at all).

Instances

Instances details
CaseBuiltin DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

data CaserBuiltin uni Source #

A data version of CaseBuiltin. we parameterize the evaluator by a CaserBuiltin so that the caller can choose whether to use the caseBuiltin method or the always failing caser (the latter is required for earlier protocol versions when we didn't support casing on builtins).

Constructors

CaserBuiltin 

Fields

Instances

Instances details
CaseBuiltin uni ⇒ Default (CaserBuiltin uni) Source # 
Instance details

Defined in PlutusCore.Builtin.Case

Methods

defCaserBuiltin uni Source #

NFData (CaserBuiltin uni) Source # 
Instance details

Defined in PlutusCore.Builtin.Case

Methods

rnfCaserBuiltin uni → () Source #

NoThunks (CaserBuiltin uni) Source # 
Instance details

Defined in PlutusCore.Builtin.Case