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

PlutusCore.Arity

Synopsis

Documentation

data Param Source #

Is the next argument a term or a type?

Constructors

TermParam 
TypeParam 

Instances

Instances details
Show Param Source # 
Instance details

Defined in PlutusCore.Arity

Eq Param Source # 
Instance details

Defined in PlutusCore.Arity

Methods

(==)ParamParamBool Source #

(/=)ParamParamBool Source #

Pretty Param Source # 
Instance details

Defined in PlutusCore.Arity

Methods

prettyParamDoc ann Source #

prettyList ∷ [Param] → Doc ann Source #

type Arity = [Param] Source #

The (syntactic) arity of a term. That is, a record of the arguments that the term expects before it may do some work. Since we have both type and lambda abstractions, this is not a simple argument count, but rather a list of values indicating whether the next argument should be a term or a type.

Note that this is the syntactic arity, i.e. it just corresponds to the number of syntactic lambda and type abstractions on the outside of the term. It is thus an under-approximation of how many arguments the term may need. e.g. consider the term let id = x -> x in id: the variable id has syntactic arity [], but does in fact need an argument before it does any work.

typeSchemeArityTypeScheme val args res → Arity Source #

Get the Arity from a TypeScheme.

builtinArity ∷ ∀ uni fun. ToBuiltinMeaning uni fun ⇒ Proxy uni → BuiltinSemanticsVariant fun → fun → Arity Source #

Get the arity of a builtin function from the BuiltinSemanticsVariant.