plutus-core-1.0.0.1: Language library for Plutus Core
Safe Haskell None
Language Haskell2010

PlutusCore.Name

Synopsis

Types

data Name Source #

A Name represents variables/names in Plutus Core.

Constructors

Name

Fields

Instances

Instances details
Eq Name Source #
Instance details

Defined in PlutusCore.Name

Ord Name Source #
Instance details

Defined in PlutusCore.Name

Show Name Source #
Instance details

Defined in PlutusCore.Name

Generic Name Source #
Instance details

Defined in PlutusCore.Name

Associated Types

type Rep Name :: Type -> Type Source #

Hashable Name Source #
Instance details

Defined in PlutusCore.Name

NFData Name Source #
Instance details

Defined in PlutusCore.Name

Flat Name Source #
Instance details

Defined in PlutusCore.Flat

ToScopedName Name Source #
Instance details

Defined in PlutusCore.Check.Scoping

Lift Name Source #
Instance details

Defined in PlutusCore.Name

HasPrettyConfigName config => PrettyBy config Name Source #
Instance details

Defined in PlutusCore.Name

HasUnique Name TermUnique Source #
Instance details

Defined in PlutusCore.Name

name ~ Name => Reference Name ( Term tyname name uni fun) Source #
Instance details

Defined in PlutusCore.Core.Instance.Scoping

Methods

referenceVia :: ( forall name0. ToScopedName name0 => name0 -> NameAnn ) -> Name -> Term tyname name uni fun NameAnn -> Term tyname name uni fun NameAnn Source #

name ~ Name => Reference Name ( Term tyname name uni fun) Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name0. ToScopedName name0 => name0 -> NameAnn ) -> Name -> Term tyname name uni fun NameAnn -> Term tyname name uni fun NameAnn Source #

name ~ Name => Reference Name ( Binding tyname name uni fun) Source #

Unlike other 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. ToScopedName name0 => name0 -> NameAnn ) -> Name -> Binding tyname name uni fun NameAnn -> Binding tyname name uni fun NameAnn Source #

Flat ( Binder Name ) Source #
Instance details

Defined in PlutusCore.Flat

AsTypeError ( Error uni fun ann) ( Term TyName Name uni fun ()) uni fun ann Source #
Instance details

Defined in PlutusCore.Error

AsTypeError ( Error uni fun a) ( Term TyName Name uni fun ()) uni fun a Source #
Instance details

Defined in PlutusIR.Error

( GEq uni, Closed uni, Everywhere uni Eq , Eq fun, Eq ann) => Eq ( Term Name uni fun ann) Source #
Instance details

Defined in UntypedPlutusCore.Core.Instance.Eq

( GEq uni, Closed uni, Everywhere uni Eq , Eq fun, Eq ann) => Eq ( Term TyName Name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Eq

HasConstant ( Term TyName Name uni fun ()) Source #
Instance details

Defined in PlutusCore.Builtin.HasConstant

( Reference TyName t, Reference Name t) => Reference ( Binding TyName Name uni fun ann) t Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name. ToScopedName name => name -> NameAnn ) -> Binding TyName Name uni fun ann -> t NameAnn -> t NameAnn Source #

( Reference TyName t, Reference Name t) => Reference ( Datatype TyName Name uni fun ann) t Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name. ToScopedName name => name -> NameAnn ) -> Datatype TyName Name uni fun ann -> t NameAnn -> t NameAnn Source #

type Rep Name Source #
Instance details

Defined in PlutusCore.Name

newtype TyName Source #

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

Constructors

TyName

Instances

Instances details
Eq TyName Source #
Instance details

Defined in PlutusCore.Name

Ord TyName Source #
Instance details

Defined in PlutusCore.Name

Show TyName Source #
Instance details

Defined in PlutusCore.Name

Generic TyName Source #
Instance details

Defined in PlutusCore.Name

Hashable TyName Source #
Instance details

Defined in PlutusCore.Name

NFData TyName Source #
Instance details

Defined in PlutusCore.Name

Flat TyName Source #
Instance details

Defined in PlutusCore.Flat

Wrapped TyName Source #
Instance details

Defined in PlutusCore.Name

ToScopedName TyName Source #
Instance details

Defined in PlutusCore.Check.Scoping

Lift TyName Source #
Instance details

Defined in PlutusCore.Name

HasPrettyConfigName config => PrettyBy config TyName Source #
Instance details

Defined in PlutusCore.Name

HasUnique TyName TypeUnique Source #
Instance details

Defined in PlutusCore.Name

tyname ~ TyName => Reference TyName ( Type tyname uni) Source #
Instance details

Defined in PlutusCore.Core.Instance.Scoping

Methods

referenceVia :: ( forall name. ToScopedName name => name -> NameAnn ) -> TyName -> Type tyname uni NameAnn -> Type tyname uni NameAnn Source #

tyname ~ TyName => Reference TyName ( Term tyname name uni fun) Source #
Instance details

Defined in PlutusCore.Core.Instance.Scoping

Methods

referenceVia :: ( forall name0. ToScopedName name0 => name0 -> NameAnn ) -> TyName -> Term tyname name uni fun NameAnn -> Term tyname name uni fun NameAnn Source #

tyname ~ TyName => Reference TyName ( Term tyname name uni fun) Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name0. ToScopedName name0 => name0 -> NameAnn ) -> TyName -> Term tyname name uni fun NameAnn -> Term tyname name uni fun NameAnn Source #

tyname ~ TyName => Reference TyName ( Binding tyname name uni fun) Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name0. ToScopedName name0 => name0 -> NameAnn ) -> TyName -> Binding tyname name uni fun NameAnn -> Binding tyname name uni fun NameAnn Source #

tyname ~ TyName => Reference TyName ( Datatype tyname name uni fun) Source #

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. ToScopedName name0 => name0 -> NameAnn ) -> TyName -> Datatype tyname name uni fun NameAnn -> Datatype tyname name uni fun NameAnn Source #

tyname ~ TyName => Reference TyName ( VarDecl tyname name uni fun) Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name0. ToScopedName name0 => name0 -> NameAnn ) -> TyName -> VarDecl tyname name uni fun NameAnn -> VarDecl tyname name uni fun NameAnn Source #

Flat ( Binder TyName ) Source #
Instance details

Defined in PlutusCore.Flat

( GEq uni, Eq ann) => Eq ( Type TyName uni ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Eq

TermLike ( Term name uni fun) TyName name uni fun Source #
Instance details

Defined in UntypedPlutusCore.Core.Type

Methods

var :: ann -> name -> Term name uni fun ann Source #

tyAbs :: ann -> TyName -> Kind ann -> Term name uni fun ann -> Term name uni fun ann Source #

lamAbs :: ann -> name -> Type TyName uni ann -> Term name uni fun ann -> Term name uni fun ann Source #

apply :: ann -> Term name uni fun ann -> Term name uni fun ann -> Term name uni fun ann Source #

constant :: ann -> Some ( ValueOf uni) -> Term name uni fun ann Source #

builtin :: ann -> fun -> Term name uni fun ann Source #

tyInst :: ann -> Term name uni fun ann -> Type TyName uni ann -> Term name uni fun ann Source #

unwrap :: ann -> Term name uni fun ann -> Term name uni fun ann Source #

iWrap :: ann -> Type TyName uni ann -> Type TyName uni ann -> Term name uni fun ann -> Term name uni fun ann Source #

error :: ann -> Type TyName uni ann -> Term name uni fun ann Source #

termLet :: ann -> TermDef ( Term name uni fun) TyName name uni fun ann -> Term name uni fun ann -> Term name uni fun ann Source #

typeLet :: ann -> TypeDef TyName uni ann -> Term name uni fun ann -> Term name uni fun ann Source #

AsTypeError ( Error uni fun ann) ( Term TyName Name uni fun ()) uni fun ann Source #
Instance details

Defined in PlutusCore.Error

AsTypeError ( Error uni fun a) ( Term TyName Name uni fun ()) uni fun a Source #
Instance details

Defined in PlutusIR.Error

( GEq uni, Closed uni, Everywhere uni Eq , Eq fun, Eq ann) => Eq ( Term TyName Name uni fun ann) Source #
Instance details

Defined in PlutusCore.Core.Instance.Eq

HasConstant ( Term TyName Name uni fun ()) Source #
Instance details

Defined in PlutusCore.Builtin.HasConstant

( Reference TyName t, Reference Name t) => Reference ( Binding TyName Name uni fun ann) t Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name. ToScopedName name => name -> NameAnn ) -> Binding TyName Name uni fun ann -> t NameAnn -> t NameAnn Source #

( Reference TyName t, Reference Name t) => Reference ( Datatype TyName Name uni fun ann) t Source #
Instance details

Defined in PlutusIR.Core.Instance.Scoping

Methods

referenceVia :: ( forall name. ToScopedName name => name -> NameAnn ) -> Datatype TyName Name uni fun ann -> t NameAnn -> t NameAnn Source #

type Rep TyName Source #
Instance details

Defined in PlutusCore.Name

type Rep TyName = D1 (' MetaData "TyName" "PlutusCore.Name" "plutus-core-1.0.0.1-76bWF9ZEWyb4eDyjHx0kCS" ' True ) ( C1 (' MetaCons "TyName" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unTyName") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Name )))
type Unwrapped TyName Source #
Instance details

Defined in PlutusCore.Name

newtype Unique Source #

A unique identifier

Constructors

Unique

Instances

Instances details
Enum Unique Source #
Instance details

Defined in PlutusCore.Name

Eq Unique Source #
Instance details

Defined in PlutusCore.Name

Ord Unique Source #
Instance details

Defined in PlutusCore.Name

Show Unique Source #
Instance details

Defined in PlutusCore.Name

Hashable Unique Source #
Instance details

Defined in PlutusCore.Name

NFData Unique Source #
Instance details

Defined in PlutusCore.Name

Flat Unique Source #
Instance details

Defined in PlutusCore.Flat

Pretty Unique Source #
Instance details

Defined in PlutusCore.Name

ExMemoryUsage Unique Source #
Instance details

Defined in PlutusCore.Evaluation.Machine.ExMemory

Lift Unique Source #
Instance details

Defined in PlutusCore.Name

HasUnique Unique Unique Source #
Instance details

Defined in PlutusCore.Name

class Coercible unique Unique => HasUnique a unique | a -> unique where Source #

Types which have a Unique attached to them, mostly names.

Minimal complete definition

Nothing

Methods

unique :: Lens' a unique Source #

The default implementation of HasUnique for newtypes.

default unique :: ( Wrapped a, HasUnique ( Unwrapped a) unique', Coercible unique' unique) => Lens' a unique Source #

theUnique :: HasUnique name unique => Lens' name Unique Source #

A lens focused on the Unique of a name.

newtype UniqueMap unique a Source #

A mapping from uniques to values of type a .

Constructors

UniqueMap

Functions

insertByUnique :: Coercible unique Unique => unique -> a -> UniqueMap unique a -> UniqueMap unique a Source #

Insert a value by a unique.

insertByName :: HasUnique name unique => name -> a -> UniqueMap unique a -> UniqueMap unique a Source #

Insert a value by the unique of a name.

insertByNameIndex :: ( HasUnique name unique1, Coercible unique2 Unique ) => name -> a -> UniqueMap unique2 a -> UniqueMap unique2 a Source #

Insert a value by the index of the unique of a name. Unlike insertByUnique and insertByName , this function does not provide any static guarantees, so you can for example insert by a type-level name in a map from term-level uniques.

fromFoldable :: Foldable f => (i -> a -> UniqueMap unique a -> UniqueMap unique a) -> f (i, a) -> UniqueMap unique a Source #

Convert a Foldable into a UniqueMap using the given insertion function.

fromUniques :: Foldable f => Coercible Unique unique => f (unique, a) -> UniqueMap unique a Source #

Convert a Foldable with uniques into a UniqueMap .

fromNames :: Foldable f => HasUnique name unique => f (name, a) -> UniqueMap unique a Source #

Convert a Foldable with names into a UniqueMap .

lookupUnique :: Coercible unique Unique => unique -> UniqueMap unique a -> Maybe a Source #

Look up a value by a unique.

lookupName :: HasUnique name unique => name -> UniqueMap unique a -> Maybe a Source #

Look up a value by the unique of a name.

lookupNameIndex :: ( HasUnique name unique1, Coercible unique2 Unique ) => name -> UniqueMap unique2 a -> Maybe a Source #

Look up a value by the index of the unique of a name. Unlike lookupUnique and lookupName , this function does not provide any static guarantees, so you can for example look up a type-level name in a map from term-level uniques.

mapNameString :: ( Text -> Text ) -> Name -> Name Source #

Apply a function to the string representation of a Name .

mapTyNameString :: ( Text -> Text ) -> TyName -> TyName Source #

Apply a function to the string representation of a TyName .