plutus-core-0.1.0.0: Language library for Plutus Core
Safe HaskellNone
LanguageHaskell2010

PlutusCore.Default

Synopsis

Documentation

data DefaultUni a where Source #

The universe used by default.

Instances

Instances details
HasUniApply DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

matchUniApply :: DefaultUni tb -> r -> (forall k l (f :: k -> l) (a :: k). tb ~ Esc (f a) => DefaultUni (Esc f) -> DefaultUni (Esc a) -> r) -> r Source #

Closed DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type Everywhere DefaultUni constr Source #

Methods

encodeUni :: DefaultUni a -> [Int] Source #

withDecodedUni :: (forall k (a :: k). Typeable k => DefaultUni (Esc a) -> DecodeUniM r) -> DecodeUniM r Source #

bring :: Everywhere DefaultUni constr => proxy constr -> DefaultUni (Esc a) -> (constr a => r) -> r Source #

ToKind DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

toSingKind :: forall k (a :: k). DefaultUni (Esc a) -> SingKind k Source #

TestTypesFromTheUniverseAreAllKnown DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

GShow DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

gshowsPrec :: forall (a :: k). Int -> DefaultUni a -> ShowS Source #

GEq DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

geq :: forall (a :: k) (b :: k). DefaultUni a -> DefaultUni b -> Maybe (a :~: b) Source #

GCompare DefaultUni Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

gcompare :: forall (a :: k) (b :: k). DefaultUni a -> DefaultUni b -> GOrdering a b Source #

HasConstantIn DefaultUni term => KnownTypeIn DefaultUni term Int Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> Int -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) Int Source #

KnownBuiltinTypeIn DefaultUni term Data => KnownTypeIn DefaultUni term Data Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> Data -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) Data Source #

KnownBuiltinTypeIn DefaultUni term Bool => KnownTypeIn DefaultUni term Bool Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> Bool -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) Bool Source #

KnownBuiltinTypeIn DefaultUni term () => KnownTypeIn DefaultUni term () Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> () -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) () Source #

KnownBuiltinTypeIn DefaultUni term Text => KnownTypeIn DefaultUni term Text Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> Text -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) Text Source #

KnownBuiltinTypeIn DefaultUni term ByteString => KnownTypeIn DefaultUni term ByteString Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> ByteString -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) ByteString Source #

KnownBuiltinTypeIn DefaultUni term Integer => KnownTypeIn DefaultUni term Integer Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> Integer -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) Integer Source #

UniOf term ~ DefaultUni => KnownTypeIn DefaultUni term Void Source # 
Instance details

Defined in PlutusCore.Examples.Builtins

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> Void -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) Void Source #

(Contains DefaultUni f, Contains DefaultUni a) => Contains DefaultUni (f a :: k2) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

knownUni :: DefaultUni (Esc (f a)) Source #

KnownBuiltinTypeIn DefaultUni term [a] => KnownTypeIn DefaultUni term [a] Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> [a] -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) [a] Source #

KnownBuiltinTypeIn DefaultUni term (a, b) => KnownTypeIn DefaultUni term (a, b) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> (a, b) -> m term Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> term -> Either (ErrorWithCause err cause) (a, b) Source #

Show (DefaultUni a) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Contains DefaultUni Bool Source # 
Instance details

Defined in PlutusCore.Default.Universe

Contains DefaultUni Integer Source # 
Instance details

Defined in PlutusCore.Default.Universe

Contains DefaultUni () Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

knownUni :: DefaultUni (Esc ()) Source #

Contains DefaultUni ByteString Source # 
Instance details

Defined in PlutusCore.Default.Universe

Contains DefaultUni Text Source # 
Instance details

Defined in PlutusCore.Default.Universe

Contains DefaultUni Data Source # 
Instance details

Defined in PlutusCore.Default.Universe

KnownBuiltinTypeAst DefaultUni Bool => KnownTypeAst DefaultUni Bool Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles Bool :: [Hole] Source #

type ToBinds Bool :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy Bool -> Type TyName DefaultUni () Source #

KnownTypeAst DefaultUni Int Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles Int :: [Hole] Source #

type ToBinds Int :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy Int -> Type TyName DefaultUni () Source #

KnownBuiltinTypeAst DefaultUni Integer => KnownTypeAst DefaultUni Integer Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles Integer :: [Hole] Source #

type ToBinds Integer :: [Some TyNameRep] Source #

KnownBuiltinTypeAst DefaultUni () => KnownTypeAst DefaultUni () Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles () :: [Hole] Source #

type ToBinds () :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy () -> Type TyName DefaultUni () Source #

KnownBuiltinTypeAst DefaultUni ByteString => KnownTypeAst DefaultUni ByteString Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles ByteString :: [Hole] Source #

type ToBinds ByteString :: [Some TyNameRep] Source #

KnownBuiltinTypeAst DefaultUni Text => KnownTypeAst DefaultUni Text Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles Text :: [Hole] Source #

type ToBinds Text :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy Text -> Type TyName DefaultUni () Source #

KnownTypeAst DefaultUni Void Source # 
Instance details

Defined in PlutusCore.Examples.Builtins

Associated Types

type ToHoles Void :: [Hole] Source #

type ToBinds Void :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy Void -> Type TyName DefaultUni () Source #

KnownBuiltinTypeAst DefaultUni Data => KnownTypeAst DefaultUni Data Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles Data :: [Hole] Source #

type ToBinds Data :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy Data -> Type TyName DefaultUni () Source #

KnownBuiltinTypeAst DefaultUni [a] => KnownTypeAst DefaultUni ([a] :: Type) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles [a] :: [Hole] Source #

type ToBinds [a] :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy [a] -> Type0 TyName DefaultUni () Source #

KnownBuiltinTypeAst DefaultUni (a, b) => KnownTypeAst DefaultUni ((a, b) :: Type) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type ToHoles (a, b) :: [Hole] Source #

type ToBinds (a, b) :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy (a, b) -> Type0 TyName DefaultUni () Source #

Contains DefaultUni (,) Source # 
Instance details

Defined in PlutusCore.Default.Universe

Contains DefaultUni [] Source # 
Instance details

Defined in PlutusCore.Default.Universe

Methods

knownUni :: DefaultUni (Esc []) Source #

type Everywhere DefaultUni constr Source # 
Instance details

Defined in PlutusCore.Default.Universe

type Everywhere DefaultUni constr = (Permits constr Integer, Permits constr ByteString, Permits constr Text, Permits constr (), Permits constr Bool, Permits constr [], Permits constr (,), Permits constr Data)

pattern DefaultUniList :: forall a k1 k2 (f :: k1 -> k2) (a1 :: k1). () => forall. (a ~ Esc (f a1), Esc f ~ Esc []) => DefaultUni (Esc a1) -> DefaultUni a Source #

pattern DefaultUniPair :: forall a k1 k2 (f1 :: k1 -> k2) (a1 :: k1) k3 k4 (f2 :: k3 -> k4) (a2 :: k3). () => forall. (a ~ Esc (f1 a1), Esc f1 ~ Esc (f2 a2), Esc f2 ~ Esc (,)) => DefaultUni (Esc a2) -> DefaultUni (Esc a1) -> DefaultUni a Source #

module Universe

data DefaultFun Source #

Default built-in functions.

Instances

Instances details
Bounded DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Enum DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Eq DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Ord DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Show DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Ix DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Generic DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Associated Types

type Rep DefaultFun :: Type -> Type Source #

Hashable DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

NFData DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Methods

rnf :: DefaultFun -> () Source #

Flat DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Pretty DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

ExMemoryUsage DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

PrettyBy PrettyConfigPlc DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

Associated Types

type CostingPart uni DefaultFun Source #

type Rep DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

type Rep DefaultFun = D1 ('MetaData "DefaultFun" "PlutusCore.Default.Builtins" "plutus-core-0.1.0.0-2XLgUgaJ2q72oJTCJd5lmc" 'False) (((((C1 ('MetaCons "AddInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SubtractInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MultiplyInteger" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "DivideInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "QuotientInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RemainderInteger" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ModInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EqualsInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LessThanInteger" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "LessThanEqualsInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "AppendByteString" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ConsByteString" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "SliceByteString" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LengthOfByteString" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IndexByteString" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "EqualsByteString" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LessThanByteString" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LessThanEqualsByteString" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Sha2_256" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Sha3_256" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Blake2b_256" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "VerifySignature" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AppendString" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EqualsString" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EncodeUtf8" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "DecodeUtf8" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IfThenElse" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ChooseUnit" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Trace" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FstPair" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SndPair" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ChooseList" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MkCons" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HeadList" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "TailList" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NullList" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ChooseData" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ConstrData" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "MapData" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ListData" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IData" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "BData" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UnConstrData" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UnMapData" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "UnListData" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UnIData" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UnBData" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "EqualsData" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MkPairData" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MkNilData" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MkNilPairData" 'PrefixI 'False) (U1 :: Type -> Type)))))))
type CostingPart uni DefaultFun Source # 
Instance details

Defined in PlutusCore.Default.Builtins

nonZeroArg :: (Integer -> Integer -> Integer) -> Integer -> Integer -> EvaluationResult Integer Source #

Turn a function into another function that returns EvaluationFailure when its second argument is 0 or calls the original function otherwise and wraps the result in EvaluationSuccess. Useful for correctly handling div, mod, etc.

builtinTagWidth :: NumBits Source #

Using 7 bits to encode builtin tags.