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

PlutusCore.Builtin.KnownType

Synopsis

Documentation

data BuiltinError Source #

The type of errors that readKnown and makeKnown can return.

Instances

Instances details
Show BuiltinError Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Eq BuiltinError Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Pretty BuiltinError Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Methods

pretty ∷ BuiltinError → Doc ann Source #

prettyList ∷ [BuiltinError] → Doc ann Source #

MonadError BuiltinError BuiltinResult Source #

throwError puts every operational unlifting error into the BuiltinFailure logs. This is to compensate for the historical lack of error message content in operational errors (structural ones don't have this problem) in our evaluators (the CK and CEK machines). It would be better to fix the underlying issue and allow operational evaluation errors to carry some form of content, but for now we just fix the symptom in order for the end user to see the error message that they are supposed to see. The fix even makes some sense: what we do here is we emulate logging when the thrown unlifting error is an operational one, i.e. this is similar to what some builtins do manually (like when a crypto builtin fails and puts info about the failure into the logs).

Instance details

Defined in PlutusCore.Builtin.Result

class GEqL f a where Source #

A version of GEq that fixes a in place, which allows us to create an inlinable recursive implementation of geqL.

The way it works is that whenever there's recursion, we look up the recursive case in the current context (i.e. the dictionary) instead of actually calling geqL recursively (even though it's gonna look like we do exactly that, because there's no way to distinguish between a recursive call and a dictionary lookup as the two share the same name, although to help GHC choose a lookup we sprinkle the perhaps unreliable LoopBreaker in the DefaultUni instance of this class).

Alligning things this way allows us to inline arbitrarily deep recursion for as long as types keep being monomorphic.

For example, the MapData builtin accepts a [(Data, Data)] and with geqL matching on all of DefaultUniProtoList, DefaultUniProtoPair and DefaultUniData gets inlined in the denotation of the builtin. For the Constr builtin that resulted in a 4.3% speedup at the time this comment was written.

Methods

geqL ∷ f (Esc a) → f (Esc b) → EvaluationResult (a :~: b) Source #

Instances

Instances details
AllBuiltinArgs DefaultUni (GEqL DefaultUni) a ⇒ GEqL DefaultUni a Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

geqL ∷ DefaultUni (Esc a) → DefaultUni (Esc b) → EvaluationResult (a :~: b) Source #

GEqL uni a ⇒ GEqL (LoopBreaker uni) a Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

geqL ∷ LoopBreaker uni (Esc a) → LoopBreaker uni (Esc b) → EvaluationResult (a :~: b) Source #

newtype LoopBreaker uni a Source #

In f = ... f ... where f is a class method, how do you know if f is going to be a recursive call or a type class method call? If both type check, then you don't really know how GHC is going to play it. So we add this data type to make sure that the RHS f will have to become a type class method call.

Can GHC turn that method call into a recursive one once type classes are resolved? Dunno, but at least we've introduced an obstacle preventing GHC from immediately creating a non-inlinable recursive definition.

Constructors

LoopBreaker (uni a) 

Instances

Instances details
GEqL uni a ⇒ GEqL (LoopBreaker uni) a Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

geqL ∷ LoopBreaker uni (Esc a) → LoopBreaker uni (Esc b) → EvaluationResult (a :~: b) Source #

type KnownBuiltinTypeIn uni val a = (HasConstantIn uni val, PrettyParens (SomeTypeIn uni), GEqL uni a, uni `HasTermLevel` a) Source #

A constraint for "a is a ReadKnownIn and MakeKnownIn by means of being included in uni".

type KnownBuiltinType val a = KnownBuiltinTypeIn (UniOf val) val a Source #

A constraint for "a is a ReadKnownIn and MakeKnownIn by means of being included in UniOf term".

data BuiltinResult a Source #

The monad that makeKnown runs in. Equivalent to ExceptT BuiltinError (Writer (DList Text)), except optimized in two ways:

  1. everything is strict
  2. has the BuiltinSuccess constructor that is used for returning a value with no logs attached, which is the most common case for us, so it helps a lot not to construct and deconstruct a redundant tuple

Moving from ExceptT BuiltinError (Writer (DList Text)) to this data type gave us a speedup of 8% of total evaluation time.

Logs are represented as a DList, because we don't particularly care about the efficiency of logging, since there's no logging on the chain and builtins don't emit much anyway. Otherwise we'd have to use text-builder or text-builder-linear or something of this sort.

Instances

Instances details
MonadFail BuiltinResult Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Methods

fail ∷ String → BuiltinResult a Source #

Foldable BuiltinResult Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Methods

fold ∷ Monoid m ⇒ BuiltinResult m → m Source #

foldMap ∷ Monoid m ⇒ (a → m) → BuiltinResult a → m Source #

foldMap' ∷ Monoid m ⇒ (a → m) → BuiltinResult a → m Source #

foldr ∷ (a → b → b) → b → BuiltinResult a → b Source #

foldr' ∷ (a → b → b) → b → BuiltinResult a → b Source #

foldl ∷ (b → a → b) → b → BuiltinResult a → b Source #

foldl' ∷ (b → a → b) → b → BuiltinResult a → b Source #

foldr1 ∷ (a → a → a) → BuiltinResult a → a Source #

foldl1 ∷ (a → a → a) → BuiltinResult a → a Source #

toList ∷ BuiltinResult a → [a] Source #

null ∷ BuiltinResult a → Bool Source #

length ∷ BuiltinResult a → Int Source #

elem ∷ Eq a ⇒ a → BuiltinResult a → Bool Source #

maximum ∷ Ord a ⇒ BuiltinResult a → a Source #

minimum ∷ Ord a ⇒ BuiltinResult a → a Source #

sum ∷ Num a ⇒ BuiltinResult a → a Source #

product ∷ Num a ⇒ BuiltinResult a → a Source #

Applicative BuiltinResult Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Functor BuiltinResult Source # 
Instance details

Defined in PlutusCore.Builtin.Result

Methods

fmap ∷ (a → b) → BuiltinResult a → BuiltinResult b Source #

(<$) ∷ a → BuiltinResult b → BuiltinResult a Source #

Monad BuiltinResult Source # 
Instance details

Defined in PlutusCore.Builtin.Result

MonadError BuiltinError BuiltinResult Source #

throwError puts every operational unlifting error into the BuiltinFailure logs. This is to compensate for the historical lack of error message content in operational errors (structural ones don't have this problem) in our evaluators (the CK and CEK machines). It would be better to fix the underlying issue and allow operational evaluation errors to carry some form of content, but for now we just fix the symptom in order for the end user to see the error message that they are supposed to see. The fix even makes some sense: what we do here is we emulate logging when the thrown unlifting error is an operational one, i.e. this is similar to what some builtins do manually (like when a crypto builtin fails and puts info about the failure into the logs).

Instance details

Defined in PlutusCore.Builtin.Result

KnownTypeAst tyname uni a ⇒ KnownTypeAst tyname uni (BuiltinResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

Associated Types

type IsBuiltin uni (BuiltinResult a) ∷ Bool Source #

type ToHoles uni hole (BuiltinResult a) ∷ [Hole] Source #

type ToBinds uni acc (BuiltinResult a) ∷ [Some TyNameRep] Source #

Methods

typeAst ∷ Type0 tyname uni () Source #

MakeKnownIn uni val a ⇒ MakeKnownIn uni val (BuiltinResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

(TypeError ('Text "\8216BuiltinResult\8217 cannot appear in the type of an argument") ∷ Constraint, uni ~ UniOf val) ⇒ ReadKnownIn uni val (BuiltinResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

readKnown ∷ val → ReadKnownM (BuiltinResult a) Source #

Show a ⇒ Show (BuiltinResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.Result

type ToBinds uni acc (BuiltinResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type ToBinds uni acc (BuiltinResult a ∷ Type) = ToBinds uni acc a
type ToHoles uni _1 (BuiltinResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type ToHoles uni _1 (BuiltinResult a ∷ Type) = '[TypeHole a ∷ Hole]
type IsBuiltin uni (BuiltinResult a ∷ Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type IsBuiltin uni (BuiltinResult a ∷ Type) = 'False

type ReadKnownM = Either BuiltinError Source #

The monad that readKnown runs in.

data Spine a Source #

A non-empty spine. Isomorphic to NonEmpty, except is strict and is defined as a single recursive data type.

Constructors

SpineLast a 
SpineCons a (Spine a) 

Instances

Instances details
Foldable Spine Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

fold ∷ Monoid m ⇒ Spine m → m Source #

foldMap ∷ Monoid m ⇒ (a → m) → Spine a → m Source #

foldMap' ∷ Monoid m ⇒ (a → m) → Spine a → m Source #

foldr ∷ (a → b → b) → b → Spine a → b Source #

foldr' ∷ (a → b → b) → b → Spine a → b Source #

foldl ∷ (b → a → b) → b → Spine a → b Source #

foldl' ∷ (b → a → b) → b → Spine a → b Source #

foldr1 ∷ (a → a → a) → Spine a → a Source #

foldl1 ∷ (a → a → a) → Spine a → a Source #

toList ∷ Spine a → [a] Source #

null ∷ Spine a → Bool Source #

length ∷ Spine a → Int Source #

elem ∷ Eq a ⇒ a → Spine a → Bool Source #

maximum ∷ Ord a ⇒ Spine a → a Source #

minimum ∷ Ord a ⇒ Spine a → a Source #

sum ∷ Num a ⇒ Spine a → a Source #

product ∷ Num a ⇒ Spine a → a Source #

Functor Spine Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

fmap ∷ (a → b) → Spine a → Spine b Source #

(<$) ∷ a → Spine b → Spine a Source #

PrettyBy config a ⇒ DefaultPrettyBy config (Spine a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

defaultPrettyBy ∷ config → Spine a → Doc ann Source #

defaultPrettyListBy ∷ config → [Spine a] → Doc ann Source #

PrettyDefaultBy config (Spine a) ⇒ PrettyBy config (Spine a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

prettyBy ∷ config → Spine a → Doc ann Source #

prettyListBy ∷ config → [Spine a] → Doc ann Source #

Show a ⇒ Show (Spine a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

showsPrec ∷ Int → Spine a → ShowS Source #

show ∷ Spine a → String Source #

showList ∷ [Spine a] → ShowS Source #

Eq a ⇒ Eq (Spine a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

(==) ∷ Spine a → Spine a → Bool Source #

(/=) ∷ Spine a → Spine a → Bool Source #

Pretty a ⇒ Pretty (Spine a) Source #
>>> import Text.Pretty
>>> pretty (SpineCons 'a' $ SpineLast 'b')
[a, b] 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

pretty ∷ Spine a → Doc ann Source #

prettyList ∷ [Spine a] → Doc ann Source #

data HeadSpine err a b Source #

The head-spine form of an iterated application. Provides O(1) access to the head of the application. NonEmpty a ~ HeadSpine a a, except is strict and the no-spine case is made a separate constructor for performance reasons (it only takes a single pattern match to access the head when there's no spine this way, while otherwise we'd also need to match on the spine to ensure that it's empty -- and the no-spine case is by far the most common one, hence we want to optimize it).

Used in built-in functions returning function applications such as CaseList.

Constructors

HeadOnly a 
HeadSpine a (Spine b) 
HeadError ~err 

Instances

Instances details
(PrettyBy config err, PrettyBy config a, PrettyBy config (Spine b)) ⇒ DefaultPrettyBy config (HeadSpine err a b) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

defaultPrettyBy ∷ config → HeadSpine err a b → Doc ann Source #

defaultPrettyListBy ∷ config → [HeadSpine err a b] → Doc ann Source #

PrettyDefaultBy config (HeadSpine err a b) ⇒ PrettyBy config (HeadSpine err a b) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

prettyBy ∷ config → HeadSpine err a b → Doc ann Source #

prettyListBy ∷ config → [HeadSpine err a b] → Doc ann Source #

Bifunctor (HeadSpine err) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

bimap ∷ (a → b) → (c → d) → HeadSpine err a c → HeadSpine err b d Source #

first ∷ (a → b) → HeadSpine err a c → HeadSpine err b c Source #

second ∷ (b → c) → HeadSpine err a b → HeadSpine err a c Source #

Functor (HeadSpine err a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

fmap ∷ (a0 → b) → HeadSpine err a a0 → HeadSpine err a b Source #

(<$) ∷ a0 → HeadSpine err a b → HeadSpine err a a0 Source #

(Show a, Show b, Show err) ⇒ Show (HeadSpine err a b) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

showsPrec ∷ Int → HeadSpine err a b → ShowS Source #

show ∷ HeadSpine err a b → String Source #

showList ∷ [HeadSpine err a b] → ShowS Source #

(Eq a, Eq b, Eq err) ⇒ Eq (HeadSpine err a b) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

(==) ∷ HeadSpine err a b → HeadSpine err a b → Bool Source #

(/=) ∷ HeadSpine err a b → HeadSpine err a b → Bool Source #

(Pretty err, Pretty a, Pretty b) ⇒ Pretty (HeadSpine err a b) Source #
>>> import Text.Pretty
>>> pretty (HeadOnly 'z')
z
>>> pretty (HeadSpine 'f' (SpineCons 'x' $ SpineLast 'y'))
f `applyN` [x, y] 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

pretty ∷ HeadSpine err a b → Doc ann Source #

prettyList ∷ [HeadSpine err a b] → Doc ann Source #

headSpine ∷ a → [b] → HeadSpine err a b Source #

Construct HeadSpine from head and list.

type MonoHeadSpine err a = HeadSpine err a a Source #

HeadSpine but the type of head and spine is same

class uni ~ UniOf val ⇒ MakeKnownIn uni val a where Source #

Minimal complete definition

Nothing

Methods

makeKnown ∷ a → BuiltinResult val Source #

Convert a Haskell value to the corresponding PLC value. The inverse of readKnown.

default makeKnown ∷ KnownBuiltinType val a ⇒ a → BuiltinResult val Source #

Instances

Instances details
UniOf term ~ DefaultUni ⇒ MakeKnownIn DefaultUni term Void Source # 
Instance details

Defined in PlutusCore.Examples.Builtins

Methods

makeKnown ∷ Void → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Int16 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Int16 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Int32 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Int32 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Int64 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Int64 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Int8 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Int8 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Word16 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Word16 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Word32 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Word32 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Word64 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Word64 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Word8 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Word8 → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term ByteString ⇒ MakeKnownIn DefaultUni term ByteString Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Element ⇒ MakeKnownIn DefaultUni term Element Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Element → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Element ⇒ MakeKnownIn DefaultUni term Element Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Element → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term MlResult ⇒ MakeKnownIn DefaultUni term MlResult Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Data ⇒ MakeKnownIn DefaultUni term Data Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Data → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term ByteString ⇒ MakeKnownIn DefaultUni term CByteString Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term CInteger Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ MakeKnownIn DefaultUni term DataNodeCount Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term IntegerCostedLiterally Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term NumBytesCostedAsNumWords Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Text ⇒ MakeKnownIn DefaultUni term TextCostedByByteLength Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ MakeKnownIn DefaultUni term ValueMaxDepth Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ MakeKnownIn DefaultUni term ValueOuterDepth Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ MakeKnownIn DefaultUni term ValueOuterSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ MakeKnownIn DefaultUni term ValueTotalSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ MakeKnownIn DefaultUni term Value Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Value → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Text ⇒ MakeKnownIn DefaultUni term Text Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Text → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Integer Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Integer → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Natural Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Natural → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term () ⇒ MakeKnownIn DefaultUni term () Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ () → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Bool ⇒ MakeKnownIn DefaultUni term Bool Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Bool → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Int Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Int → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ MakeKnownIn DefaultUni term Word Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Word → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term (Vector a) ⇒ MakeKnownIn DefaultUni term (Vector a) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ Vector a → BuiltinResult term Source #

KnownBuiltinTypeIn DefaultUni term [a] ⇒ MakeKnownIn DefaultUni term [a] Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ [a] → BuiltinResult term Source #

MakeKnownIn uni val a ⇒ MakeKnownIn uni val (BuiltinResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

(TypeError ('Text "Use \8216BuiltinResult\8217 instead of \8216EvaluationResult\8217") ∷ Constraint, uni ~ UniOf val) ⇒ MakeKnownIn uni val (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

KnownBuiltinTypeIn DefaultUni term (a, b) ⇒ MakeKnownIn DefaultUni term (a, b) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown ∷ (a, b) → BuiltinResult term Source #

uni ~ UniOf val ⇒ MakeKnownIn uni val (Opaque val rep) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

makeKnown ∷ Opaque val rep → BuiltinResult val Source #

HasConstantIn uni val ⇒ MakeKnownIn uni val (SomeConstant uni rep) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

makeKnown ∷ SomeConstant uni rep → BuiltinResult val Source #

MakeKnownIn DefaultUni term a ⇒ MakeKnownIn DefaultUni term (MetaForall name a) Source # 
Instance details

Defined in PlutusCore.Examples.Builtins

Methods

makeKnown ∷ MetaForall name a → BuiltinResult term Source #

readKnownConstant ∷ ∀ val a. KnownBuiltinType val a ⇒ val → ReadKnownM a Source #

Convert a constant embedded into a PLC term to the corresponding Haskell value.

type MakeKnown val = MakeKnownIn (UniOf val) val Source #

class uni ~ UniOf val ⇒ ReadKnownIn uni val a where Source #

Minimal complete definition

Nothing

Methods

readKnown ∷ val → ReadKnownM a Source #

Convert a PLC value to the corresponding Haskell value. The inverse of makeKnown.

default readKnown ∷ KnownBuiltinType val a ⇒ val → ReadKnownM a Source #

Instances

Instances details
UniOf term ~ DefaultUni ⇒ ReadKnownIn DefaultUni term Void Source # 
Instance details

Defined in PlutusCore.Examples.Builtins

Methods

readKnown ∷ term → ReadKnownM Void Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Int16 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Int16 Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Int32 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Int32 Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Int64 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Int64 Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Int8 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Int8 Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Word16 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Word16 Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Word32 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Word32 Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Word64 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Word64 Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Word8 Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Word8 Source #

KnownBuiltinTypeIn DefaultUni term ByteString ⇒ ReadKnownIn DefaultUni term ByteString Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM ByteString Source #

KnownBuiltinTypeIn DefaultUni term Element ⇒ ReadKnownIn DefaultUni term Element Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Element Source #

KnownBuiltinTypeIn DefaultUni term Element ⇒ ReadKnownIn DefaultUni term Element Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Element Source #

KnownBuiltinTypeIn DefaultUni term MlResult ⇒ ReadKnownIn DefaultUni term MlResult Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM MlResult Source #

KnownBuiltinTypeIn DefaultUni term Data ⇒ ReadKnownIn DefaultUni term Data Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Data Source #

KnownBuiltinTypeIn DefaultUni term ByteString ⇒ ReadKnownIn DefaultUni term CByteString Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term CInteger Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM CInteger Source #

KnownBuiltinTypeIn DefaultUni term Value ⇒ ReadKnownIn DefaultUni term DataNodeCount Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term IntegerCostedLiterally Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term NumBytesCostedAsNumWords Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Text ⇒ ReadKnownIn DefaultUni term TextCostedByByteLength Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ ReadKnownIn DefaultUni term ValueMaxDepth Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ ReadKnownIn DefaultUni term ValueOuterDepth Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ ReadKnownIn DefaultUni term ValueOuterSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ ReadKnownIn DefaultUni term ValueTotalSize Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeIn DefaultUni term Value ⇒ ReadKnownIn DefaultUni term Value Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Value Source #

KnownBuiltinTypeIn DefaultUni term Text ⇒ ReadKnownIn DefaultUni term Text Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Text Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Integer Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Integer Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Natural Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Natural Source #

KnownBuiltinTypeIn DefaultUni term () ⇒ ReadKnownIn DefaultUni term () Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM () Source #

KnownBuiltinTypeIn DefaultUni term Bool ⇒ ReadKnownIn DefaultUni term Bool Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Bool Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Int Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Int Source #

KnownBuiltinTypeIn DefaultUni term Integer ⇒ ReadKnownIn DefaultUni term Word Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM Word Source #

KnownBuiltinTypeIn DefaultUni term (Vector a) ⇒ ReadKnownIn DefaultUni term (Vector a) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM (Vector a) Source #

KnownBuiltinTypeIn DefaultUni term [a] ⇒ ReadKnownIn DefaultUni term [a] Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM [a] Source #

(TypeError ('Text "\8216BuiltinResult\8217 cannot appear in the type of an argument") ∷ Constraint, uni ~ UniOf val) ⇒ ReadKnownIn uni val (BuiltinResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

readKnown ∷ val → ReadKnownM (BuiltinResult a) Source #

(TypeError ('Text "Use \8216BuiltinResult\8217 instead of \8216EvaluationResult\8217") ∷ Constraint, uni ~ UniOf val) ⇒ ReadKnownIn uni val (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

KnownBuiltinTypeIn DefaultUni term (a, b) ⇒ ReadKnownIn DefaultUni term (a, b) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown ∷ term → ReadKnownM (a, b) Source #

uni ~ UniOf val ⇒ ReadKnownIn uni val (Opaque val rep) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

readKnown ∷ val → ReadKnownM (Opaque val rep) Source #

HasConstantIn uni val ⇒ ReadKnownIn uni val (SomeConstant uni rep) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

readKnown ∷ val → ReadKnownM (SomeConstant uni rep) Source #

type ReadKnown val = ReadKnownIn (UniOf val) val Source #

makeKnownOrFail ∷ MakeKnownIn uni val a ⇒ a → EvaluationResult val Source #

Same as makeKnown, but allows for neither emitting nor storing the cause of a failure.

readKnownSelf ∷ (ReadKnown val a, BuiltinErrorToEvaluationError structural operational) ⇒ val → Either (ErrorWithCause (EvaluationError structural operational) val) a Source #

Same as readKnown, but the cause of a potential failure is the provided term itself.