plutus-tx-1.38.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx

Synopsis

Documentation

type CompiledCode = CompiledCodeIn DefaultUni DefaultFun Source #

CompiledCodeIn instantiated with default built-in types and functions.

data CompiledCodeIn uni fun a Source #

A compiled Plutus Tx program. The last type parameter indicates the type of the Haskell expression that was compiled, and hence the type of the compiled code.

Note: the compiled PLC program does *not* have normalized types, if you want to put it on the chain you must normalize the types first.

getPlc ∷ (Closed uni, uni `Everywhere` Flat, Flat fun) ⇒ CompiledCodeIn uni fun a → Program NamedDeBruijn uni fun SrcSpans Source #

Get the actual Plutus Core program out of a CompiledCodeIn.

getPlcNoAnn ∷ (Closed uni, uni `Everywhere` Flat, Flat fun) ⇒ CompiledCodeIn uni fun a → Program NamedDeBruijn uni fun () Source #

getPir ∷ (Closed uni, uni `Everywhere` Flat, Flat fun) ⇒ CompiledCodeIn uni fun a → Maybe (Program TyName Name uni fun SrcSpans) Source #

Get the Plutus IR program, if there is one, out of a CompiledCodeIn.

getPirNoAnn ∷ (Closed uni, uni `Everywhere` Flat, Flat fun) ⇒ CompiledCodeIn uni fun a → Maybe (Program TyName Name uni fun ()) Source #

applyCode ∷ (Closed uni, uni `Everywhere` Flat, Flat fun, Pretty fun, Everywhere uni PrettyConst, PrettyBy RenderContext (SomeTypeIn uni)) ⇒ CompiledCodeIn uni fun (a → b) → CompiledCodeIn uni fun a → Either String (CompiledCodeIn uni fun b) Source #

Apply a compiled function to a compiled argument. Will fail if the versions don't match.

unsafeApplyCode ∷ (Closed uni, uni `Everywhere` Flat, Flat fun, Pretty fun, Everywhere uni PrettyConst, PrettyBy RenderContext (SomeTypeIn uni)) ⇒ CompiledCodeIn uni fun (a → b) → CompiledCodeIn uni fun a → CompiledCodeIn uni fun b Source #

Apply a compiled function to a compiled argument. Will throw if the versions don't match, should only be used in non-production code.

data BuiltinData Source #

A type corresponding to the Plutus Core builtin equivalent of Data.

The point of this type is to be an opaque equivalent of Data, so as to ensure that it is only used in ways that the compiler can handle.

As such, you should use this type in your on-chain code, and in any data structures that you want to be representable on-chain.

For off-chain usage, there are conversion functions builtinDataToData and dataToBuiltinData, but note that these will not work on-chain.

Instances

Instances details
Data BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → BuiltinData → c BuiltinData Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c BuiltinData Source #

toConstrBuiltinDataConstr Source #

dataTypeOfBuiltinDataDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c BuiltinData) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c BuiltinData) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → BuiltinDataBuiltinData Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → BuiltinData → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → BuiltinData → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → BuiltinData → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → BuiltinData → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinData → m BuiltinData Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinData → m BuiltinData Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BuiltinData → m BuiltinData Source #

Generic BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Associated Types

type Rep BuiltinDataTypeType Source #

Show BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

rnfBuiltinData → () Source #

Eq BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasBlueprintDefinition BuiltinData Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinData ∷ [Type] Source #

HasFromBuiltin BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinData Source #

MkNil BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Eq BuiltinData Source # 
Instance details

Defined in PlutusTx.Eq

FromData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

Show BuiltinData Source # 
Instance details

Defined in PlutusTx.Show

Pretty BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

prettyBuiltinDataDoc ann Source #

prettyList ∷ [BuiltinData] → Doc ann Source #

HasBlueprintSchema BuiltinData referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schemaSchema referencedTypes Source #

HasFromOpaque BuiltinData BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinData BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni DataLift uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinDataRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni DataTypeable uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinDataRTCompile uni fun (Type TyName uni ()) Source #

MkNil (BuiltinPair BuiltinData BuiltinData) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

type Rep BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

type Rep BuiltinData = D1 ('MetaData "BuiltinData" "PlutusTx.Builtins.Internal" "plutus-tx-1.38.0.0-inplace" 'False) (C1 ('MetaCons "BuiltinData" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Data)))
type Unroll BuiltinData Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

data Data Source #

A generic "data" type.

The main constructor Constr represents a datatype value in sum-of-products form: Constr i args represents a use of the ith constructor along with its arguments.

The other constructors are various primitives.

Constructors

Constr Integer [Data] 
Map [(Data, Data)] 
List [Data] 
I Integer 
B ByteString 

Instances

Instances details
Data Data 
Instance details

Defined in PlutusCore.Data

Methods

gfoldl ∷ (∀ d b. Data0 d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Data → c Data Source #

gunfold ∷ (∀ b r. Data0 b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c Data Source #

toConstrDataConstr Source #

dataTypeOfDataDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data0 d ⇒ c (t d)) → Maybe (c Data) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data0 d, Data0 e) ⇒ c (t d e)) → Maybe (c Data) Source #

gmapT ∷ (∀ b. Data0 b ⇒ b → b) → DataData Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data0 d ⇒ d → r') → Data → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data0 d ⇒ d → r') → Data → r Source #

gmapQ ∷ (∀ d. Data0 d ⇒ d → u) → Data → [u] Source #

gmapQiInt → (∀ d. Data0 d ⇒ d → u) → Data → u Source #

gmapMMonad m ⇒ (∀ d. Data0 d ⇒ d → m d) → Data → m Data Source #

gmapMpMonadPlus m ⇒ (∀ d. Data0 d ⇒ d → m d) → Data → m Data Source #

gmapMoMonadPlus m ⇒ (∀ d. Data0 d ⇒ d → m d) → Data → m Data Source #

Generic Data 
Instance details

Defined in PlutusCore.Data

Associated Types

type Rep DataTypeType Source #

Methods

fromDataRep Data x Source #

toRep Data x → Data Source #

Read Data 
Instance details

Defined in PlutusCore.Data

Show Data 
Instance details

Defined in PlutusCore.Data

Methods

showsPrecIntDataShowS Source #

showDataString Source #

showList ∷ [Data] → ShowS Source #

NFData Data 
Instance details

Defined in PlutusCore.Data

Methods

rnfData → () Source #

Eq Data 
Instance details

Defined in PlutusCore.Data

Methods

(==)DataDataBool Source #

(/=)DataDataBool Source #

Ord Data 
Instance details

Defined in PlutusCore.Data

Methods

compareDataDataOrdering Source #

(<)DataDataBool Source #

(<=)DataDataBool Source #

(>)DataDataBool Source #

(>=)DataDataBool Source #

maxDataDataData Source #

minDataDataData Source #

Hashable Data 
Instance details

Defined in PlutusCore.Data

Methods

hashWithSaltIntDataInt Source #

hashDataInt Source #

NoThunks Data 
Instance details

Defined in PlutusCore.Data

HasToBuiltin Data Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type ToBuiltin Data Source #

Pretty Data 
Instance details

Defined in PlutusCore.Data

Methods

prettyDataDoc ann Source #

prettyList ∷ [Data] → Doc ann Source #

Serialise Data 
Instance details

Defined in PlutusCore.Data

PrettyBy ConstConfig Data 
Instance details

Defined in PlutusCore.Pretty.PrettyConst

Methods

prettyByConstConfigDataDoc ann Source #

prettyListByConstConfig → [Data] → Doc ann Source #

KnownBuiltinTypeIn DefaultUni term DataMakeKnownIn DefaultUni term Data 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term DataReadKnownIn DefaultUni term Data 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Data Source #

Contains DefaultUni Data 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeAst tyname DefaultUni DataKnownTypeAst tyname DefaultUni Data 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type IsBuiltin DefaultUni DataBool Source #

type ToHoles DefaultUni hole Data ∷ [Hole] Source #

type ToBinds DefaultUni acc Data ∷ [Some TyNameRep] Source #

Methods

typeAstType tyname DefaultUni () Source #

type Rep Data 
Instance details

Defined in PlutusCore.Data

type ToBuiltin Data Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

type IsBuiltin DefaultUni Data 
Instance details

Defined in PlutusCore.Default.Universe

type ToBinds DefaultUni acc Data 
Instance details

Defined in PlutusCore.Default.Universe

type ToHoles DefaultUni hole Data 
Instance details

Defined in PlutusCore.Default.Universe

class ToData (a ∷ Type) where Source #

A typeclass for types that can be converted to and from BuiltinData.

Methods

toBuiltinData ∷ a → BuiltinData Source #

Convert a value to BuiltinData.

Instances

Instances details
ToData Void Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinBLS12_381_G1_Element Source #

For the BLS12-381 G1 and G2 types we use the compress functions to convert to a ByteString and then encode that as Data as usual. We have to be more careful going the other way because we decode a Data object to (possibly) get a BuiltinByteString and then uncompress the underlying ByteString to get a group element. However uncompression can fail so we have to check what happens: we don't use bls12_381_G?_uncompress because that invokes error if something goes wrong (but we do use it for unsafeFromData).

Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "toBuiltinData is not supported for BuiltinBLS12_381_MlResult") ∷ Constraint) ⇒ ToData BuiltinBLS12_381_MlResult Source #

We do not provide instances of any of these classes for BuiltinBLS12_381_MlResult since there is no serialisation format: we expect that values of that type will only occur as the result of on-chain computations.

Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData Rational Source # 
Instance details

Defined in PlutusTx.Ratio

ToData Sqrt Source # 
Instance details

Defined in PlutusTx.Sqrt

ToData Integer Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData () Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

toBuiltinData ∷ () → BuiltinData Source #

ToData Bool Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ ToData Int Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData (List a) Source # 
Instance details

Defined in PlutusTx.Data.List

ToData a ⇒ ToData (Maybe a) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

ToData a ⇒ ToData [a] Source # 
Instance details

Defined in PlutusTx.IsData.Class

Methods

toBuiltinData ∷ [a] → BuiltinData Source #

(ToData a, ToData b) ⇒ ToData (Either a b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(ToData k, ToData v) ⇒ ToData (Map k v) Source #

Hand-written instances to use the underlying Map type in Data, and to be reasonably efficient.

Instance details

Defined in PlutusTx.AssocMap

Methods

toBuiltinDataMap k v → BuiltinData Source #

ToData (Map k a) Source # 
Instance details

Defined in PlutusTx.Data.AssocMap

Methods

toBuiltinDataMap k a → BuiltinData Source #

(ToData a, ToData b) ⇒ ToData (These a b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(ToData a, ToData b) ⇒ ToData (a, b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

toBuiltinData ∷ (a, b) → BuiltinData Source #

(ToData a, ToData b, ToData c) ⇒ ToData (a, b, c) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

toBuiltinData ∷ (a, b, c) → BuiltinData Source #

(ToData a, ToData b, ToData c, ToData d) ⇒ ToData (a, b, c, d) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

toBuiltinData ∷ (a, b, c, d) → BuiltinData Source #

class FromData (a ∷ Type) where Source #

Methods

fromBuiltinDataBuiltinDataMaybe a Source #

Convert a value from BuiltinData, returning Nothing if this fails.

Instances

Instances details
FromData Void Source # 
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") ∷ Constraint) ⇒ FromData BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

FromData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

FromData Rational Source # 
Instance details

Defined in PlutusTx.Ratio

FromData Sqrt Source # 
Instance details

Defined in PlutusTx.Sqrt

FromData Integer Source # 
Instance details

Defined in PlutusTx.IsData.Class

FromData () Source # 
Instance details

Defined in PlutusTx.IsData.Instances

FromData Bool Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ FromData Int Source # 
Instance details

Defined in PlutusTx.IsData.Class

FromData (List a) Source # 
Instance details

Defined in PlutusTx.Data.List

FromData a ⇒ FromData (Maybe a) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

FromData a ⇒ FromData [a] Source # 
Instance details

Defined in PlutusTx.IsData.Class

(FromData a, FromData b) ⇒ FromData (Either a b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(FromData k, FromData v) ⇒ FromData (Map k v) Source #

A hand-written transformation from Data to Map. Compared to unsafeFromBuiltinData, it is safe to call when it is unknown if the Data is built with Datas Map constructor. Note that it is, however, unsafe in the sense that it assumes that any map encoded in the Data is well-formed, i.e. fromBuiltinData does not perform any deduplication of keys or of key-value pairs!

Instance details

Defined in PlutusTx.AssocMap

FromData (Map k a) Source # 
Instance details

Defined in PlutusTx.Data.AssocMap

(FromData a, FromData b) ⇒ FromData (These a b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(FromData a, FromData b) ⇒ FromData (a, b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

fromBuiltinDataBuiltinDataMaybe (a, b) Source #

(FromData a, FromData b, FromData c) ⇒ FromData (a, b, c) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

fromBuiltinDataBuiltinDataMaybe (a, b, c) Source #

(FromData a, FromData b, FromData c, FromData d) ⇒ FromData (a, b, c, d) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

fromBuiltinDataBuiltinDataMaybe (a, b, c, d) Source #

class UnsafeFromData (a ∷ Type) where Source #

Methods

unsafeFromBuiltinDataBuiltinData → a Source #

Convert a value from BuiltinData, calling error if this fails. This is typically much faster than fromBuiltinData.

When implementing this function, make sure to call unsafeFromBuiltinData rather than fromBuiltinData when converting substructures!

This is a simple type without any validation, use with caution.

Instances

Instances details
UnsafeFromData Void Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") ∷ Constraint) ⇒ UnsafeFromData BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData Rational Source # 
Instance details

Defined in PlutusTx.Ratio

UnsafeFromData Sqrt Source # 
Instance details

Defined in PlutusTx.Sqrt

UnsafeFromData Integer Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData () Source # 
Instance details

Defined in PlutusTx.IsData.Instances

UnsafeFromData Bool Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ UnsafeFromData Int Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData (List a) Source # 
Instance details

Defined in PlutusTx.Data.List

UnsafeFromData a ⇒ UnsafeFromData (Maybe a) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

UnsafeFromData a ⇒ UnsafeFromData [a] Source # 
Instance details

Defined in PlutusTx.IsData.Class

(UnsafeFromData a, UnsafeFromData b) ⇒ UnsafeFromData (Either a b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(UnsafeFromData k, UnsafeFromData v) ⇒ UnsafeFromData (Map k v) Source #

A hand-written transformation from Data to Map. It is unsafe because the caller must provide the guarantee that the Data is constructed using the Datas Map constructor. Note that it assumes, like the fromBuiltinData transformation, that the map encoded in the Data is well-formed, i.e. unsafeFromBuiltinData does not perform any deduplication of keys or of key-value pairs!

Instance details

Defined in PlutusTx.AssocMap

UnsafeFromData (Map k a) Source # 
Instance details

Defined in PlutusTx.Data.AssocMap

(UnsafeFromData a, UnsafeFromData b) ⇒ UnsafeFromData (These a b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(UnsafeFromData a, UnsafeFromData b) ⇒ UnsafeFromData (a, b) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

(UnsafeFromData a, UnsafeFromData b, UnsafeFromData c) ⇒ UnsafeFromData (a, b, c) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

unsafeFromBuiltinDataBuiltinData → (a, b, c) Source #

(UnsafeFromData a, UnsafeFromData b, UnsafeFromData c, UnsafeFromData d) ⇒ UnsafeFromData (a, b, c, d) Source # 
Instance details

Defined in PlutusTx.IsData.Instances

Methods

unsafeFromBuiltinDataBuiltinData → (a, b, c, d) Source #

toDataToData a ⇒ a → Data Source #

Convert a value to Data.

fromDataFromData a ⇒ DataMaybe a Source #

Convert a value from Data, returning Nothing if this fails.

builtinDataToDataBuiltinDataData Source #

Convert a BuiltinData into a Data. Only works off-chain.

dataToBuiltinDataDataBuiltinData Source #

Convert a Data into a BuiltinData. Only works off-chain.

unstableMakeIsDataNameQ [Dec] Source #

Generate a FromData and a ToData instance for a type. This may not be stable in the face of constructor additions, renamings, etc. Use makeIsDataIndexed if you need stability.

makeIsDataIndexedName → [(Name, Int)] → Q [Dec] Source #

Generate a ToData, 'FromData and a UnsafeFromData instances for a type, using an explicit mapping of constructor names to indices. Use this for types where you need to keep the representation stable.

makeIsDataSchemaIndexedName → [(Name, Natural)] → Q [InstanceDec] Source #

Generate a ToData, FromData, UnsafeFromData, HasBlueprintSchema instances for a type, using an explicit mapping of constructor names to indices. Use this for types where you need to keep the representation stable.

class Lift uni a Source #

Class for types which can be lifted into Plutus IR. Instances should be derived, do not write your own instance!

Minimal complete definition

lift

Instances

Instances details
Lift DefaultUni Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Lift DefaultUni Sqrt Source # 
Instance details

Defined in PlutusTx.Sqrt

Lift DefaultUni () Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

lift ∷ () → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

Lift DefaultUni Bool Source # 
Instance details

Defined in PlutusTx.Lift.Instances

HasTermLevel uni ElementLift uni BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinBLS12_381_G1_ElementRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni ElementLift uni BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinBLS12_381_G2_ElementRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni MlResultLift uni BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinBLS12_381_MlResultRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni BoolLift uni BuiltinBool Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinBoolRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni ByteStringLift uni BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinByteStringRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni DataLift uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinDataRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni IntegerLift uni BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinIntegerRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni TextLift uni BuiltinString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinStringRTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTermLevel uni () ⇒ Lift uni BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinUnitRTCompile uni fun (Term TyName Name uni fun ()) Source #

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ Lift uni Int Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftIntRTCompile uni fun (Term TyName Name uni fun ()) Source #

Lift DefaultUni (List a) Source # 
Instance details

Defined in PlutusTx.Data.List

Methods

liftList a → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

(Typeable DefaultUni a, Lift DefaultUni a) ⇒ Lift DefaultUni (Maybe a) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

(Typeable DefaultUni a, Lift DefaultUni a) ⇒ Lift DefaultUni [a] Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

lift ∷ [a] → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

(HasFromBuiltin arep, HasTermLevel uni [FromBuiltin arep]) ⇒ Lift uni (BuiltinList arep) Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinList arep → RTCompile uni fun (Term TyName Name uni fun ()) Source #

(Typeable DefaultUni a, Typeable DefaultUni b, Lift DefaultUni a, Lift DefaultUni b) ⇒ Lift DefaultUni (Either a b) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

liftEither a b → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

Lift DefaultUni [(k, v)] ⇒ Lift DefaultUni (Map k v) Source # 
Instance details

Defined in PlutusTx.AssocMap

Methods

liftMap k v → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

Lift DefaultUni (Map k a) Source # 
Instance details

Defined in PlutusTx.Data.AssocMap

Methods

liftMap k a → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

(Typeable DefaultUni a, Typeable DefaultUni b, Lift DefaultUni a, Lift DefaultUni b) ⇒ Lift DefaultUni (These a b) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

liftThese a b → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

(Typeable DefaultUni a, Typeable DefaultUni b, Lift DefaultUni a, Lift DefaultUni b) ⇒ Lift DefaultUni (a, b) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

lift ∷ (a, b) → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

(HasFromBuiltin arep, HasFromBuiltin brep, HasTermLevel uni (FromBuiltin arep, FromBuiltin brep)) ⇒ Lift uni (BuiltinPair arep brep) Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

liftBuiltinPair arep brep → RTCompile uni fun (Term TyName Name uni fun ()) Source #

(Typeable DefaultUni a, Typeable DefaultUni b, Typeable DefaultUni c, Lift DefaultUni a, Lift DefaultUni b, Lift DefaultUni c) ⇒ Lift DefaultUni (a, b, c) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

lift ∷ (a, b, c) → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

(Typeable DefaultUni a, Typeable DefaultUni b, Typeable DefaultUni c, Typeable DefaultUni d, Lift DefaultUni a, Lift DefaultUni b, Lift DefaultUni c, Lift DefaultUni d) ⇒ Lift DefaultUni (a, b, c, d) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

lift ∷ (a, b, c, d) → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

(Typeable DefaultUni a, Typeable DefaultUni b, Typeable DefaultUni c, Typeable DefaultUni d, Typeable DefaultUni e, Lift DefaultUni a, Lift DefaultUni b, Lift DefaultUni c, Lift DefaultUni d, Lift DefaultUni e) ⇒ Lift DefaultUni (a, b, c, d, e) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Methods

lift ∷ (a, b, c, d, e) → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

class Typeable uni (a ∷ k) Source #

Class for types which have a corresponding Plutus IR type. Instances should always be derived, do not write your own instance!

Minimal complete definition

typeRep

Instances

Instances details
Typeable DefaultUni Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Typeable DefaultUni Sqrt Source # 
Instance details

Defined in PlutusTx.Sqrt

Typeable DefaultUni () Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Typeable DefaultUni Bool Source # 
Instance details

Defined in PlutusTx.Lift.Instances

HasTypeLevel uni ElementTypeable uni BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

HasTypeLevel uni ElementTypeable uni BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

HasTypeLevel uni MlResultTypeable uni BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Lift.Class

HasTypeLevel uni BoolTypeable uni BuiltinBool Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinBoolRTCompile uni fun (Type TyName uni ()) Source #

HasTypeLevel uni ByteStringTypeable uni BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinByteStringRTCompile uni fun (Type TyName uni ()) Source #

HasTypeLevel uni DataTypeable uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinDataRTCompile uni fun (Type TyName uni ()) Source #

HasTypeLevel uni IntegerTypeable uni BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinIntegerRTCompile uni fun (Type TyName uni ()) Source #

HasTypeLevel uni TextTypeable uni BuiltinString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinStringRTCompile uni fun (Type TyName uni ()) Source #

HasTypeLevel uni () ⇒ Typeable uni BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinUnitRTCompile uni fun (Type TyName uni ()) Source #

(TypeError ('Text "Int is not supported, use Integer instead") ∷ Constraint) ⇒ Typeable uni Int Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy IntRTCompile uni fun (Type TyName uni ()) Source #

(Typeable uni f, Typeable uni a) ⇒ Typeable uni (f a ∷ k) Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy (f a) → RTCompile uni fun (Type TyName uni ()) Source #

Typeable DefaultUni (,,,,) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Typeable DefaultUni (,,,) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Typeable DefaultUni (,,) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Typeable DefaultUni Either Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Typeable DefaultUni Map Source # 
Instance details

Defined in PlutusTx.AssocMap

Typeable DefaultUni Map Source # 
Instance details

Defined in PlutusTx.Data.AssocMap

Typeable DefaultUni These Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Typeable DefaultUni (,) Source # 
Instance details

Defined in PlutusTx.Lift.Instances

HasTypeLevel uni (,)Typeable uni BuiltinPair Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinPairRTCompile uni fun (Type TyName uni ()) Source #

Typeable DefaultUni List Source # 
Instance details

Defined in PlutusTx.Data.List

Typeable DefaultUni Maybe Source # 
Instance details

Defined in PlutusTx.Lift.Instances

Typeable DefaultUni List Source # 
Instance details

Defined in PlutusTx.Lift.Instances

HasTypeLevel uni ListTypeable uni BuiltinList Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy BuiltinListRTCompile uni fun (Type TyName uni ()) Source #

Typeable uni (->) Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRepProxy (->) → RTCompile uni fun (Type TyName uni ()) Source #

safeLiftCode ∷ (Lift uni a, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance ()), GEq uni, AsTypeErrorExt e uni (Provenance ()), AsFreeVariableError e, AsError e uni fun (Provenance ()), MonadError e m, MonadQuote m, Typecheckable uni fun, PrettyUni uni, Pretty fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → m (CompiledCodeIn uni fun a) Source #

liftCode ∷ (Lift uni a, GEq uni, ThrowableBuiltins uni fun, Typecheckable uni fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ Version → a → CompiledCodeIn uni fun a Source #

Get a Plutus Core program corresponding to the given value as a CompiledCodeIn, throwing any errors that occur as exceptions and ignoring fresh names.

liftCodeDef ∷ (Lift uni a, GEq uni, ThrowableBuiltins uni fun, Typecheckable uni fun, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun), Hashable fun) ⇒ a → CompiledCodeIn uni fun a Source #

Get a Plutus Core program with the default version, corresponding to the given value as a CompiledCodeIn, throwing any errors that occur as exceptions and ignoring fresh names.