Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
PlutusCore.Builtin.Case
Synopsis
- class AnnotateCaseBuiltin uni where
- class CaseBuiltin uni where
- data CaserBuiltin uni = CaserBuiltin {}
- unavailableCaserBuiltin ∷ Int → CaserBuiltin uni
Documentation
class AnnotateCaseBuiltin uni where Source #
Methods
annotateCaseBuiltin ∷ UniOf 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
AnnotateCaseBuiltin DefaultUni Source # | |
Defined in PlutusCore.Default.Universe Methods annotateCaseBuiltin ∷ UniOf term ~ DefaultUni ⇒ Type TyName DefaultUni ann → [term] → Either Text [(term, [Type TyName DefaultUni ann])] Source # |
class CaseBuiltin uni where Source #
Methods
caseBuiltin ∷ UniOf 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
CaseBuiltin DefaultUni Source # | |
Defined in PlutusCore.Default.Universe Methods caseBuiltin ∷ UniOf term ~ DefaultUni ⇒ Some (ValueOf DefaultUni) → Vector term → Either Text (HeadSpine term (Some (ValueOf DefaultUni))) Source # |
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 | |
Instances
CaseBuiltin uni ⇒ Default (CaserBuiltin uni) Source # | |
Defined in PlutusCore.Builtin.Case Methods def ∷ CaserBuiltin uni Source # | |
NFData (CaserBuiltin uni) Source # | |
Defined in PlutusCore.Builtin.Case Methods rnf ∷ CaserBuiltin uni → () Source # | |
NoThunks (CaserBuiltin uni) Source # | |
Defined in PlutusCore.Builtin.Case |
unavailableCaserBuiltin ∷ Int → CaserBuiltin uni Source #