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

PlutusTx.Prelude

Synopsis

Documentation

The PlutusTx Prelude is a replacement for the Haskell Prelude that works better with Plutus Tx. You should use it if you're writing code that will be compiled with the Plutus Tx compiler. {-# LANGUAGE NoImplicitPrelude #-} import PlutusTx.Prelude

Monad

(>>=) :: Monad m => m a -> (a -> m b) -> m b infixl 1 Source #

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

'as >>= bs' can be understood as the do expression

do a <- as
   bs a

(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 Source #

Same as >>=, but with the arguments interchanged.

(>>) :: Monad m => m a -> m b -> m b infixl 1 Source #

Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.

'as >> bs' can be understood as the do expression

do as
   bs

return :: Monad m => a -> m a Source #

Inject a value into the monadic type.

Standard functions, Tuples

Tracing functions

Unit

data BuiltinUnit Source #

Instances

Instances details
Data BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinUnit -> c BuiltinUnit Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinUnit Source #

toConstr :: BuiltinUnit -> Constr Source #

dataTypeOf :: BuiltinUnit -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinUnit) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinUnit) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinUnit -> BuiltinUnit Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinUnit -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinUnit -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinUnit -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinUnit -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source #

HasBlueprintDefinition BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinUnit :: [Type] Source #

HasFromBuiltin BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinUnit Source #

HasBlueprintSchema BuiltinUnit referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinUnit () Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Methods

fromOpaque :: BuiltinUnit -> () Source #

HasToOpaque () BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Methods

toOpaque :: () -> BuiltinUnit Source #

HasTermLevel uni () => Lift uni BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinUnit -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni () => Typeable uni BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinUnit -> RTCompile uni fun (Type TyName uni ()) Source #

type Unroll BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

String

data BuiltinString Source #

Instances

Instances details
Data BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinString -> c BuiltinString Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinString Source #

toConstr :: BuiltinString -> Constr Source #

dataTypeOf :: BuiltinString -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinString) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinString) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinString -> BuiltinString Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinString -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinString -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinString -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinString -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source #

IsString BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Show BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasBlueprintDefinition BuiltinString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinString :: [Type] Source #

HasFromBuiltin BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinString Source #

Eq BuiltinString Source # 
Instance details

Defined in PlutusTx.Eq

Monoid BuiltinString Source # 
Instance details

Defined in PlutusTx.Monoid

Semigroup BuiltinString Source # 
Instance details

Defined in PlutusTx.Semigroup

Show BuiltinString Source # 
Instance details

Defined in PlutusTx.Show

HasBlueprintSchema BuiltinString referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinString BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinString BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Text => Lift uni BuiltinString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinString -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Text => Typeable uni BuiltinString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinString -> RTCompile uni fun (Type TyName uni ()) Source #

type Unroll BuiltinString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

emptyString :: BuiltinString Source #

An empty String.

equalsString :: BuiltinString -> BuiltinString -> Bool Source #

Check if two strings are equal

encodeUtf8 :: BuiltinString -> BuiltinByteString Source #

Convert a String into a ByteString.

Error

error :: () -> a Source #

Aborts evaluation with an error.

check :: Bool -> BuiltinUnit Source #

Checks a Bool and aborts if it is false.

Booleans

Integer numbers

data Integer Source #

Arbitrary precision integers. In contrast with fixed-size integral types such as Int, the Integer type represents the entire infinite range of integers.

Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.

If the value is small (fit into an Int), IS constructor is used. Otherwise Integer and IN constructors are used to store a BigNat representing respectively the positive or the negative value magnitude.

Invariant: Integer and IN are used iff value doesn't fit in IS

Instances

Instances details
FromJSON Integer 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

parseJSON :: Value -> Parser Integer

parseJSONList :: Value -> Parser [Integer]

omittedField :: Maybe Integer

FromJSONKey Integer 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

fromJSONKey :: FromJSONKeyFunction Integer

fromJSONKeyList :: FromJSONKeyFunction [Integer]

ToJSON Integer 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

toJSON :: Integer -> Value

toEncoding :: Integer -> Encoding

toJSONList :: [Integer] -> Value

toEncodingList :: [Integer] -> Encoding

omitField :: Integer -> Bool

ToJSONKey Integer 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

toJSONKey :: ToJSONKeyFunction Integer

toJSONKeyList :: ToJSONKeyFunction [Integer]

Data Integer

Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer Source #

toConstr :: Integer -> Constr Source #

dataTypeOf :: Integer -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) Source #

gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source #

Enum Integer

Since: base-2.1

Instance details

Defined in GHC.Enum

Ix Integer

Since: base-2.1

Instance details

Defined in GHC.Ix

Num Integer

Since: base-2.1

Instance details

Defined in GHC.Num

Read Integer

Since: base-2.1

Instance details

Defined in GHC.Read

Integral Integer

Since: base-2.0.1

Instance details

Defined in GHC.Real

Real Integer

Since: base-2.0.1

Instance details

Defined in GHC.Real

Show Integer

Since: base-2.1

Instance details

Defined in GHC.Show

Subtractive Integer 
Instance details

Defined in Basement.Numerical.Subtractive

Associated Types

type Difference Integer

Methods

(-) :: Integer -> Integer -> Difference Integer

Default Integer 
Instance details

Defined in Data.Default.Class

Methods

def :: Integer

NFData Integer 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Integer -> () Source #

Eq Integer 
Instance details

Defined in GHC.Num.Integer

Ord Integer 
Instance details

Defined in GHC.Num.Integer

Hashable Integer 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Integer -> Int

hash :: Integer -> Int

HasBlueprintDefinition Integer Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll Integer :: [Type] Source #

HasFromBuiltin BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinInteger Source #

HasToBuiltin Integer Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type ToBuiltin Integer Source #

MkNil BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Enum Integer Source # 
Instance details

Defined in PlutusTx.Enum

Eq Integer Source # 
Instance details

Defined in PlutusTx.Eq

Methods

(==) :: Integer -> Integer -> Bool Source #

FromData Integer Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData Integer Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData Integer Source # 
Instance details

Defined in PlutusTx.IsData.Class

AdditiveGroup Integer Source # 
Instance details

Defined in PlutusTx.Numeric

Methods

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

AdditiveMonoid Integer Source # 
Instance details

Defined in PlutusTx.Numeric

Methods

zero :: Integer Source #

AdditiveSemigroup Integer Source # 
Instance details

Defined in PlutusTx.Numeric

Methods

(+) :: Integer -> Integer -> Integer Source #

MultiplicativeMonoid Integer Source # 
Instance details

Defined in PlutusTx.Numeric

Methods

one :: Integer Source #

MultiplicativeSemigroup Integer Source # 
Instance details

Defined in PlutusTx.Numeric

Methods

(*) :: Integer -> Integer -> Integer Source #

Ord Integer Source # 
Instance details

Defined in PlutusTx.Ord

Show Integer Source # 
Instance details

Defined in PlutusTx.Show

Pretty Integer 
Instance details

Defined in Prettyprinter.Internal

Methods

pretty :: Integer -> Doc ann

prettyList :: [Integer] -> Doc ann

UniformRange Integer 
Instance details

Defined in System.Random.Internal

Methods

uniformRM :: StatefulGen g m => (Integer, Integer) -> g -> m Integer

Serialise Integer 
Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Integer -> Encoding

decode :: Decoder s Integer

encodeList :: [Integer] -> Encoding

decodeList :: Decoder s [Integer]

Pretty Rational 
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Methods

pretty :: Rational -> Doc b

prettyList :: [Rational] -> Doc b

Pretty Integer 
Instance details

Defined in Text.PrettyPrint.Annotated.WL

Methods

pretty :: Integer -> Doc b

prettyList :: [Integer] -> Doc b

HasBlueprintSchema Integer referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinInteger BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinInteger BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Integer => Lift uni BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinInteger -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

Module Integer Rational Source # 
Instance details

Defined in PlutusTx.Ratio

DefaultPrettyBy config Integer 
Instance details

Defined in Text.PrettyBy.Internal

Methods

defaultPrettyBy :: config -> Integer -> Doc ann

defaultPrettyListBy :: config -> [Integer] -> Doc ann

NonDefaultPrettyBy ConstConfig Integer 
Instance details

Defined in PlutusCore.Pretty.PrettyConst

Methods

nonDefaultPrettyBy :: ConstConfig -> Integer -> Doc ann

nonDefaultPrettyListBy :: ConstConfig -> [Integer] -> Doc ann

PrettyDefaultBy config Integer => PrettyBy config Integer 
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyBy :: config -> Integer -> Doc ann

prettyListBy :: config -> [Integer] -> Doc ann

Lift Integer 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Integer -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Integer -> Code m Integer Source #

KnownBuiltinTypeIn DefaultUni term Integer => MakeKnownIn DefaultUni term Integer 
Instance details

Defined in PlutusCore.Default.Universe

Methods

makeKnown :: Integer -> BuiltinResult term

KnownBuiltinTypeIn DefaultUni term Integer => ReadKnownIn DefaultUni term Integer 
Instance details

Defined in PlutusCore.Default.Universe

Methods

readKnown :: term -> ReadKnownM Integer

Contains DefaultUni Integer 
Instance details

Defined in PlutusCore.Default.Universe

Methods

knownUni :: DefaultUni (Esc Integer)

HasTypeLevel uni Integer => Typeable uni BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinInteger -> RTCompile uni fun (Type TyName uni ()) Source #

KnownNat n => Reifies (n :: Nat) Integer 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy n -> Integer

KnownBuiltinTypeAst tyname DefaultUni Integer => KnownTypeAst tyname DefaultUni Integer 
Instance details

Defined in PlutusCore.Default.Universe

Associated Types

type IsBuiltin DefaultUni Integer :: Bool

type ToHoles DefaultUni Integer :: [Hole]

type ToBinds DefaultUni acc Integer :: [Some TyNameRep]

Methods

typeAst :: Type tyname DefaultUni ()

type Difference Integer 
Instance details

Defined in Basement.Numerical.Subtractive

type Difference Integer = Integer
type Unroll Integer Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinInteger Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

type ToBuiltin Integer Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

type IsBuiltin DefaultUni Integer 
Instance details

Defined in PlutusCore.Default.Universe

type IsBuiltin DefaultUni Integer = IsBuiltin DefaultUni (ElaborateBuiltin DefaultUni Integer)
type ToHoles DefaultUni Integer 
Instance details

Defined in PlutusCore.Default.Universe

type ToHoles DefaultUni Integer = ToHoles DefaultUni (ElaborateBuiltin DefaultUni Integer)
type ToBinds DefaultUni acc Integer 
Instance details

Defined in PlutusCore.Default.Universe

type ToBinds DefaultUni acc Integer = ToBinds DefaultUni acc (ElaborateBuiltin DefaultUni Integer)

divide :: Integer -> Integer -> Integer Source #

Integer division, rounding downwards

>>> divide (-41) 5
-9

modulo :: Integer -> Integer -> Integer Source #

Integer remainder, always positive for a positive divisor

>>> modulo (-41) 5
4

quotient :: Integer -> Integer -> Integer Source #

Integer division, rouding towards zero

>>> quotient (-41) 5
-8

remainder :: Integer -> Integer -> Integer Source #

Integer remainder, same sign as dividend

>>> remainder (-41) 5
-1

Maybe

Either

Lists

zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c] Source #

Plutus Tx version of zipWith.

sortBy :: (a -> a -> Ordering) -> [a] -> [a] Source #

Plutus Tx version of sortBy.

head :: [a] -> a Source #

Plutus Tx version of head.

filter :: (a -> Bool) -> [a] -> [a] Source #

Plutus Tx version of filter.

>>> filter (> 1) [1, 2, 3, 4]
[2,3,4]

(++) :: [a] -> [a] -> [a] infixr 5 Source #

Plutus Tx version of (++).

>>> [0, 1, 2] ++ [1, 2, 3, 4]
[0,1,2,1,2,3,4]

zip :: [a] -> [b] -> [(a, b)] Source #

Plutus Tx version of zip.

map :: forall a b. (a -> b) -> [a] -> [b] Source #

Plutus Tx version of map.

>>> map (\i -> i + 1) [1, 2, 3]
[2,3,4]

listToMaybe :: [a] -> Maybe a Source #

Plutus Tx version of listToMaybe.

uncons :: [a] -> Maybe (a, [a]) Source #

Plutus Tx version of uncons.

tail :: [a] -> [a] Source #

Plutus Tx version of tail.

last :: [a] -> a Source #

Plutus Tx version of last.

null :: [a] -> Bool Source #

Test whether a list is empty.

replicate :: forall a. Integer -> a -> [a] Source #

Plutus Tx version of replicate.

dropWhile :: forall a. (a -> Bool) -> [a] -> [a] Source #

Plutus Tx version of dropWhile.

take :: Integer -> [a] -> [a] Source #

Plutus Tx version of take.

drop :: Integer -> [a] -> [a] Source #

Plutus Tx version of drop.

splitAt :: Integer -> [a] -> ([a], [a]) Source #

Plutus Tx version of splitAt.

reverse :: [a] -> [a] Source #

Plutus Tx version of reverse.

and :: [Bool] -> Bool Source #

Returns the conjunction of a list of Bools.

or :: [Bool] -> Bool Source #

Returns the disjunction of a list of Bools.

any :: forall a. (a -> Bool) -> [a] -> Bool Source #

Determines whether any element of the structure satisfies the predicate.

all :: forall a. (a -> Bool) -> [a] -> Bool Source #

Determines whether all elements of the list satisfy the predicate.

elem :: Eq a => a -> [a] -> Bool Source #

Does the element occur in the list?

notElem :: Eq a => a -> [a] -> Bool Source #

The negation of elem.

(!!) :: forall a. [a] -> Integer -> a infixl 9 Source #

Plutus Tx version of (!!).

>>> [10, 11, 12] !! 2
12

unzip :: [(a, b)] -> ([a], [b]) Source #

Plutus Tx version of unzip.

find :: forall a. (a -> Bool) -> [a] -> Maybe a Source #

Returns the leftmost element matching the predicate, or Nothing if there's no such element.

findIndex :: (a -> Bool) -> [a] -> Maybe Integer Source #

Plutus Tx version of findIndex.

findIndices :: (a -> Bool) -> [a] -> [Integer] Source #

Plutus Tx version of findIndices.

nub :: Eq a => [a] -> [a] Source #

Plutus Tx version of nub.

nubBy :: (a -> a -> Bool) -> [a] -> [a] Source #

Plutus Tx version of nubBy.

partition :: (a -> Bool) -> [a] -> ([a], [a]) Source #

Plutus Tx version of partition.

sort :: Ord a => [a] -> [a] Source #

Plutus Tx version of sort.

uniqueElement :: [a] -> Maybe a Source #

Return the element in the list, if there is precisely one.

revAppend :: forall a. [a] -> [a] -> [a] Source #

Cons each element of the first list to the second one in reverse order (i.e. the last element of the first list is the head of the result).

revAppend xs ys === reverse xs ++ ys
>>> revAppend "abc" "de"
"cbade"

indexBuiltinList :: forall a. BuiltinList a -> Integer -> a Source #

Index operator for builtin lists.

>>> indexBuiltinList (toBuiltin [10, 11, 12]) 2
12

ByteStrings

data BuiltinByteString Source #

An opaque type representing Plutus Core ByteStrings.

Instances

Instances details
Data BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinByteString -> c BuiltinByteString Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinByteString Source #

toConstr :: BuiltinByteString -> Constr Source #

dataTypeOf :: BuiltinByteString -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinByteString) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinByteString) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinByteString -> BuiltinByteString Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinByteString -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinByteString -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinByteString -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinByteString -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

IsString BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Monoid BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Semigroup BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Show BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

rnf :: BuiltinByteString -> () Source #

Eq BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Hashable BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

ByteArray BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

allocRet :: Int -> (Ptr p -> IO a) -> IO (a, BuiltinByteString)

ByteArrayAccess BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasBlueprintDefinition BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinByteString :: [Type] Source #

HasFromBuiltin BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinByteString Source #

Eq BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Eq

FromData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

Monoid BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Monoid

Ord BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Ord

Semigroup BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Semigroup

Show BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Show

Pretty BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

pretty :: BuiltinByteString -> Doc ann

prettyList :: [BuiltinByteString] -> Doc ann

Serialise BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

encode :: BuiltinByteString -> Encoding

decode :: Decoder s BuiltinByteString

encodeList :: [BuiltinByteString] -> Encoding

decodeList :: Decoder s [BuiltinByteString]

HasBlueprintSchema BuiltinByteString referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinByteString BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinByteString BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni ByteString => Lift uni BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinByteString -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni ByteString => Typeable uni BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinByteString -> RTCompile uni fun (Type TyName uni ()) Source #

type Unroll BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

consByteString :: Integer -> BuiltinByteString -> BuiltinByteString Source #

Adds a byte to the front of a ByteString.

takeByteString :: Integer -> BuiltinByteString -> BuiltinByteString Source #

Returns the n length prefix of a ByteString.

dropByteString :: Integer -> BuiltinByteString -> BuiltinByteString Source #

Returns the suffix of a ByteString after n elements.

sliceByteString :: Integer -> Integer -> BuiltinByteString -> BuiltinByteString Source #

Returns the substring of a ByteString from index start of length n.

lengthOfByteString :: BuiltinByteString -> Integer Source #

Returns the length of a ByteString.

indexByteString :: BuiltinByteString -> Integer -> Integer Source #

Returns the byte of a ByteString at index.

emptyByteString :: BuiltinByteString Source #

An empty ByteString.

decodeUtf8 :: BuiltinByteString -> BuiltinString Source #

Converts a ByteString to a String.

andByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #

Perform logical AND on two BuiltinByteString arguments, as described in CIP-122.

The first argument indicates whether padding semantics should be used or not; if False, truncation semantics will be used instead.

See also

orByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #

Perform logical OR on two BuiltinByteString arguments, as described here.

The first argument indicates whether padding semantics should be used or not; if False, truncation semantics will be used instead.

See also

xorByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #

Perform logical XOR on two BuiltinByteString arguments, as described here.

The first argument indicates whether padding semantics should be used or not; if False, truncation semantics will be used instead.

See also

Bit operations

readBit :: BuiltinByteString -> Integer -> Bool Source #

Read a bit at the _bit_ index given by the Integer argument in the BuiltinByteString argument. The result will be True if the corresponding bit is set, and False if it is clear. Will error if given an out-of-bounds index argument; that is, if the index is either negative, or equal to or greater than the total number of bits in the BuiltinByteString argument.

See also

writeBits :: BuiltinByteString -> [Integer] -> Bool -> BuiltinByteString Source #

Given a BuiltinByteString, a list of indexes to change, and a boolean value b to change those indexes to, set the bit at each of the specified index as follows:

  • If b is True, set that bit;
  • Otherwise, clear that bit.

Will error if any of the indexes are out-of-bounds: that is, if the index is either negative, or equal to or greater than the total number of bits in the BuiltinByteString argument.

Note

This differs slightly from the description of the corresponding operation in CIP-122; instead of a single changelist argument comprised of pairs, we instead pass a single list of indexes to change, and a single boolean value to change those indexes to. The original proposal allowed one to set and clear bits in a single operation, but constructing the list of boolean values for the updates was somewhat expensive. If it's really necessary to set some bits and clear others then it is easier to call the function twice, once to set bits and and once to clear them.

See also

findFirstSetBit :: BuiltinByteString -> Integer Source #

Find the lowest index of a set bit in a BuiltinByteString, as per CIP-123.

If given a BuiltinByteString which consists only of zero bytes (including the empty BuiltinByteString, this returns -1.

Hashes and Signatures

sha2_256 :: BuiltinByteString -> BuiltinByteString Source #

The SHA2-256 hash of a ByteString

sha3_256 :: BuiltinByteString -> BuiltinByteString Source #

The SHA3-256 hash of a ByteString

blake2b_224 :: BuiltinByteString -> BuiltinByteString Source #

The BLAKE2B-224 hash of a ByteString

blake2b_256 :: BuiltinByteString -> BuiltinByteString Source #

The BLAKE2B-256 hash of a ByteString

keccak_256 :: BuiltinByteString -> BuiltinByteString Source #

The KECCAK-256 hash of a ByteString

ripemd_160 :: BuiltinByteString -> BuiltinByteString Source #

The RIPEMD-160 hash of a ByteString

verifyEd25519Signature Source #

Arguments

:: BuiltinByteString

Public Key (32 bytes)

-> BuiltinByteString

Message (arbirtary length)

-> BuiltinByteString

Signature (64 bytes)

-> Bool 

Ed25519 signature verification. Verify that the signature is a signature of the message by the public key. This will fail if key or the signature are not of the expected length.

verifyEcdsaSecp256k1Signature Source #

Arguments

:: BuiltinByteString

Verification key (33 bytes)

-> BuiltinByteString

Message hash (32 bytes)

-> BuiltinByteString

Signature (64 bytes)

-> Bool 

Given an ECDSA SECP256k1 verification key, an ECDSA SECP256k1 signature, and an ECDSA SECP256k1 message hash (all as BuiltinByteStrings), verify the hash with that key and signature.

Note

There are additional well-formation requirements for the arguments beyond their length:

  • The first byte of the public key must correspond to the sign of the y coordinate: this is 0x02 if y is even, and 0x03 otherwise.
  • The remaining bytes of the public key must correspond to the x coordinate, as a big-endian integer.
  • The first 32 bytes of the signature must correspond to the big-endian integer representation of _r_.
  • The last 32 bytes of the signature must correspond to the big-endian integer representation of _s_.

While this primitive accepts a hash, any caller should only pass it hashes that they computed themselves: specifically, they should receive the message from a sender and hash it, rather than receiving the hash from said sender. Failure to do so can be dangerous. Other than length, we make no requirements of what hash gets used.

See also

verifySchnorrSecp256k1Signature Source #

Arguments

:: BuiltinByteString

Verification key (32 bytes)

-> BuiltinByteString

Message (arbitrary length)

-> BuiltinByteString

Signature (64 bytes)

-> Bool 

Given a Schnorr SECP256k1 verification key, a Schnorr SECP256k1 signature, and a message (all as BuiltinByteStrings), verify the message with that key and signature.

Note

There are additional well-formation requirements for the arguments beyond their length. Throughout, we refer to co-ordinates of the point R.

  • The bytes of the public key must correspond to the x coordinate, as a big-endian integer, as specified in BIP-340.
  • The first 32 bytes of the signature must correspond to the x coordinate, as a big-endian integer, as specified in BIP-340.
  • The last 32 bytes of the signature must correspond to the bytes of s, as a big-endian integer, as specified in BIP-340.

See also

Rational numbers

data Rational Source #

Represents an arbitrary-precision ratio.

The following two invariants are maintained:

  1. The denominator is greater than zero.
  2. The numerator and denominator are coprime.

Instances

Instances details
FromJSON Rational Source #

This mimics the behaviour of Aeson's instance for Rational.

Instance details

Defined in PlutusTx.Ratio

Methods

parseJSON :: Value -> Parser Rational

parseJSONList :: Value -> Parser [Rational]

omittedField :: Maybe Rational

ToJSON Rational Source #

This mimics the behaviour of Aeson's instance for Rational.

Instance details

Defined in PlutusTx.Ratio

Methods

toJSON :: Rational -> Value

toEncoding :: Rational -> Encoding

toJSONList :: [Rational] -> Value

toEncodingList :: [Rational] -> Encoding

omitField :: Rational -> Bool

Generic Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Associated Types

type Rep Rational :: Type -> Type Source #

Show Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Eq Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Ord Rational Source # 
Instance details

Defined in PlutusTx.Ratio

HasBlueprintDefinition Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Associated Types

type Unroll Rational :: [Type] Source #

Eq Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Methods

(==) :: Rational -> Rational -> Bool Source #

FromData Rational Source # 
Instance details

Defined in PlutusTx.Ratio

ToData Rational Source # 
Instance details

Defined in PlutusTx.Ratio

UnsafeFromData Rational Source # 
Instance details

Defined in PlutusTx.Ratio

AdditiveGroup Rational Source # 
Instance details

Defined in PlutusTx.Ratio

AdditiveMonoid Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Methods

zero :: Rational Source #

AdditiveSemigroup Rational Source # 
Instance details

Defined in PlutusTx.Ratio

MultiplicativeMonoid Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Methods

one :: Rational Source #

MultiplicativeSemigroup Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Ord Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Pretty Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Methods

pretty :: Rational -> Doc ann

prettyList :: [Rational] -> Doc ann

HasSchemaDefinition Integer referencedTypes => HasBlueprintSchema Rational referencedTypes Source # 
Instance details

Defined in PlutusTx.Ratio

Methods

schema :: Schema referencedTypes Source #

Lift DefaultUni Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Methods

lift :: Rational -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source #

Module Integer Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Typeable DefaultUni Rational Source # 
Instance details

Defined in PlutusTx.Ratio

Methods

typeRep :: Proxy Rational -> RTCompile DefaultUni fun (Type TyName DefaultUni ()) Source #

type Rep Rational Source # 
Instance details

Defined in PlutusTx.Ratio

type Rep Rational = D1 ('MetaData "Rational" "PlutusTx.Ratio" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "Rational" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer)))
type Unroll Rational Source # 
Instance details

Defined in PlutusTx.Ratio

unsafeRatio :: Integer -> Integer -> Rational Source #

Makes a Rational from a numerator and a denominator.

Important note

If given a zero denominator, this function will error. If you don't mind a size increase, and care about safety, use ratio instead.

ratio :: Integer -> Integer -> Maybe Rational Source #

Safely constructs a Rational from a numerator and a denominator. Returns Nothing if given a zero denominator.

fromInteger :: Integer -> Rational Source #

Converts an Integer into the equivalent Rational.

round :: Rational -> Integer Source #

round r returns the nearest Integer value to r. If r is equidistant between two values, the even value will be given.

Data

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 :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinData -> c BuiltinData Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinData Source #

toConstr :: BuiltinData -> Constr Source #

dataTypeOf :: BuiltinData -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinData) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinData) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinData -> BuiltinData Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinData -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinData -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinData -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinData -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source #

Generic BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Associated Types

type Rep BuiltinData :: Type -> Type Source #

Show BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

rnf :: BuiltinData -> () 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

pretty :: BuiltinData -> Doc ann

prettyList :: [BuiltinData] -> Doc ann

HasBlueprintSchema BuiltinData referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema 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 Data => Lift uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinData -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Data => Typeable uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinData -> RTCompile 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.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "BuiltinData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe 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

BLS12_381

data BuiltinBLS12_381_G1_Element Source #

Instances

Instances details
Show BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Eq BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Eq

FromData BuiltinBLS12_381_G1_Element 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

UnsafeFromData BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

Pretty BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinBLS12_381_G1_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinBLS12_381_G1_Element -> RTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

data BuiltinBLS12_381_G2_Element Source #

Instances

Instances details
Show BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Eq BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Eq

FromData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

Pretty BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinBLS12_381_G2_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinBLS12_381_G2_Element -> RTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

data BuiltinBLS12_381_MlResult Source #

Instances

Instances details
Show BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

(TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => FromData BuiltinBLS12_381_MlResult 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

(TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => UnsafeFromData BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.IsData.Class

Pretty BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni MlResult => Lift uni BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinBLS12_381_MlResult -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni MlResult => Typeable uni BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinBLS12_381_MlResult -> RTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Conversions

fromOpaque :: HasFromOpaque arep a => arep -> a Source #

toOpaque :: HasToOpaque a arep => a -> arep Source #

integerToByteString :: ByteOrder -> Integer -> Integer -> BuiltinByteString Source #

Convert a BuiltinInteger into a BuiltinByteString, as described in CIP-121. The first argument indicates the endianness of the conversion and the third argument is the integer to be converted, which must be non-negative. The second argument must also be non-negative and it indicates the required width of the output. If the width is zero then the output is the smallest bytestring which can contain the converted input (and in this case, the integer 0 encodes to the empty bytestring). If the width is nonzero then the output bytestring will be padded to the required width with 0x00 bytes (on the left for big-endian conversions and on the right for little-endian conversions); if the input integer is too big to fit into a bytestring of the specified width then the conversion will fail. Conversion will also fail if the specified width is greater than 8192 or the input integer is too big to fit into a bytestring of length 8192.

byteStringToInteger :: ByteOrder -> BuiltinByteString -> Integer Source #

Convert a BuiltinByteString to a BuiltinInteger, as described in CIP-121. The first argument indicates the endianness of the conversion and the second is the bytestring to be converted. There is no limitation on the size of the bytestring. The empty bytestring is converted to the integer 0.