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

PlutusIR.Core.Type

Synopsis

Documentation

newtype TyName #

We use a newtype to enforce separation between names used for types and those used for terms.

Constructors

TyName 

Fields

Instances

Instances details
Reference TyName (Datatype tyname name uni) #

Scoping for data types is hard, so we employ some extra paranoia and reference the provided TyName in the type of every single constructor, and also apply the final head to that TyName.

Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: (forall name0. Reference instances this one does not guarantee that the name will actually be referenced, but it's too convenient to have this instance to give up on it, without it would be awkward to express "reference this binding in this thing".

Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: (forall name0. Reference TyName (Datatype tyname name uni) #

Scoping for data types is hard, so we employ some extra paranoia and reference the provided TyName in the type of every single constructor, and also apply the final head to that TyName.

Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: (forall name0. NameAnn #

type Rep (Datatype tyname name uni a) # 
Instance details

Defined in PlutusIR.Core.Type

data Recursivity #

Each multi-let-group has to be marked with its scoping: * NonRec: the identifiers introduced by this multi-let are only linearly-scoped, i.e. an identifier cannot refer to itself or later-introduced identifiers of the group. * Rec: an identifiers introduced by this multi-let group can use all other multi-lets of the same group (including itself), thus permitting (mutual) recursion.

Constructors

NonRec 
Rec 

Instances

Instances details
Semigroup Recursivity #

Recursivity can form a Semigroup / lattice, where NonRec < Rec. The lattice is ordered by "power": a non-recursive binding group can be made recursive and it will still work, but not vice versa. The semigroup operation is the "join" of the lattice.

Instance details

Defined in PlutusIR.Core.Type

Methods

(<>) :: Recursivity -> Recursivity -> Recursivity #

sconcat :: Reference instances this one does not guarantee that the name will actually be referenced, but it's too convenient to have this instance to give up on it, without it would be awkward to express "reference this binding in this thing".

Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: (forall name0. HasUniques (Term tyname name uni fun ann)

data Version #

The version of Plutus Core used by this program.

The intention is to convey different levels of backwards compatibility for existing scripts: - Major version changes are backwards-incompatible - Minor version changes are backwards-compatible - Patch version changes should be entirely invisible (and we will likely not use this level)

The version used should be changed only when the language itself changes. For example, adding a new kind of term to the language would require a minor version bump; removing a kind of term would require a major version bump.

Similarly, changing the semantics of the language will require a version bump, typically a major one. This is the main reason why the version is actually tracked in the AST: we can have two language versions with identical ASTs but different semantics, so we need to track the version explicitly.

Compatibility is about compatibility for specific scripts, not about e.g. tools which consume scripts. Adding a new kind of term does not change how existing scripts behave, but does change what tools would need to do to process scripts.

Constructors

Version 

Fields

termAnn :: Term tyname name uni fun a -> a #

bindingAnn :: Binding tyname name uni fun a -> a #

progAnn :: forall tyname name uni fun ann. Lens' (Program tyname name uni fun ann) Version #

progTerm :: forall tyname name uni fun ann tyname name uni fun. Lens (Program tyname name uni fun ann) (Program tyname name uni fun ann) (Term tyname name uni fun ann) (Term tyname name uni fun ann) #