| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PlutusTx.Prelude
Description
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.
:set -XNoImplicitPrelude
import PlutusTx.Prelude
Synopsis
- module PlutusTx.Eq
- module PlutusTx.Enum
- module PlutusTx.Ord
- module PlutusTx.Semigroup
- module PlutusTx.Monoid
- module PlutusTx.Numeric
- module PlutusTx.Function
- module PlutusTx.Functor
- module PlutusTx.Applicative
- module PlutusTx.Lattice
- (>>=) :: Monad m => m a -> (a -> m b) -> m b
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- (>>) :: Monad m => m a -> m b -> m b
- return :: Monad m => a -> m a
- module PlutusTx.Base
- module PlutusTx.Trace
- data BuiltinUnit
- data BuiltinString
- appendString :: BuiltinString -> BuiltinString -> BuiltinString
- emptyString :: BuiltinString
- equalsString :: BuiltinString -> BuiltinString -> Bool
- encodeUtf8 :: BuiltinString -> BuiltinByteString
- error :: () -> a
- check :: Bool -> BuiltinUnit
- module PlutusTx.Bool
- data Integer
- divide :: Integer -> Integer -> Integer
- modulo :: Integer -> Integer -> Integer
- quotient :: Integer -> Integer -> Integer
- remainder :: Integer -> Integer -> Integer
- even :: Integer -> Bool
- odd :: Integer -> Bool
- expMod :: Integer -> Integer -> Integer -> Integer
- module PlutusTx.Maybe
- module PlutusTx.Either
- data BuiltinByteString
- appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- consByteString :: Integer -> BuiltinByteString -> BuiltinByteString
- takeByteString :: Integer -> BuiltinByteString -> BuiltinByteString
- dropByteString :: Integer -> BuiltinByteString -> BuiltinByteString
- sliceByteString :: Integer -> Integer -> BuiltinByteString -> BuiltinByteString
- lengthOfByteString :: BuiltinByteString -> Integer
- indexByteString :: BuiltinByteString -> Integer -> Integer
- emptyByteString :: BuiltinByteString
- decodeUtf8 :: BuiltinByteString -> BuiltinString
- newtype BuiltinByteStringUtf8 = BuiltinByteStringUtf8 {}
- andByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- orByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- xorByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- complementByteString :: BuiltinByteString -> BuiltinByteString
- readBit :: BuiltinByteString -> Integer -> Bool
- writeBits :: BuiltinByteString -> [Integer] -> Bool -> BuiltinByteString
- replicateByte :: Integer -> Integer -> BuiltinByteString
- shiftByteString :: BuiltinByteString -> Integer -> BuiltinByteString
- rotateByteString :: BuiltinByteString -> Integer -> BuiltinByteString
- countSetBits :: BuiltinByteString -> Integer
- findFirstSetBit :: BuiltinByteString -> Integer
- sha2_256 :: BuiltinByteString -> BuiltinByteString
- sha3_256 :: BuiltinByteString -> BuiltinByteString
- blake2b_224 :: BuiltinByteString -> BuiltinByteString
- blake2b_256 :: BuiltinByteString -> BuiltinByteString
- keccak_256 :: BuiltinByteString -> BuiltinByteString
- ripemd_160 :: BuiltinByteString -> BuiltinByteString
- verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
- verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
- verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
- data Rational
- unsafeRatio :: Integer -> Integer -> Rational
- ratio :: Integer -> Integer -> Maybe Rational
- fromInteger :: Integer -> Rational
- round :: Rational -> Integer
- data BuiltinData
- data BuiltinList a
- data BuiltinPair a b
- class ToData a where
- toBuiltinData :: a -> BuiltinData
- class FromData a where
- fromBuiltinData :: BuiltinData -> Maybe a
- class UnsafeFromData a where
- unsafeFromBuiltinData :: BuiltinData -> a
- data BuiltinBLS12_381_G1_Element
- bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool
- bls12_381_G1_add :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_neg :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_scalarMul :: Integer -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_compress :: BuiltinBLS12_381_G1_Element -> BuiltinByteString
- bls12_381_G1_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_compressed_zero :: BuiltinByteString
- bls12_381_G1_compressed_generator :: BuiltinByteString
- data BuiltinBLS12_381_G2_Element
- bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool
- bls12_381_G2_add :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_neg :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_scalarMul :: Integer -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_compress :: BuiltinBLS12_381_G2_Element -> BuiltinByteString
- bls12_381_G2_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_compressed_zero :: BuiltinByteString
- bls12_381_G2_compressed_generator :: BuiltinByteString
- data BuiltinBLS12_381_MlResult
- bls12_381_millerLoop :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_MlResult
- bls12_381_mulMlResult :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult
- bls12_381_finalVerify :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool
- fromBuiltin :: HasFromBuiltin arep => arep -> FromBuiltin arep
- toBuiltin :: HasToBuiltin a => a -> ToBuiltin a
- fromOpaque :: HasFromOpaque arep a => arep -> a
- toOpaque :: HasToOpaque a arep => a -> arep
- integerToByteString :: ByteOrder -> Integer -> Integer -> BuiltinByteString
- byteStringToInteger :: ByteOrder -> BuiltinByteString -> Integer
Classes
module PlutusTx.Eq
module PlutusTx.Enum
module PlutusTx.Ord
module PlutusTx.Semigroup
module PlutusTx.Monoid
module PlutusTx.Numeric
module PlutusTx.Function
module PlutusTx.Functor
module PlutusTx.Applicative
module PlutusTx.Lattice
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 ' can be understood as the >>= bsdo 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 ' can be understood as the >> bsdo expression
do as bs
Standard functions, Tuples
module PlutusTx.Base
Tracing functions
module PlutusTx.Trace
Unit
data BuiltinUnit Source #
Instances
String
data BuiltinString Source #
Instances
| Data BuiltinString Source # | |||||
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 # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromString :: String -> BuiltinString Source # | |||||
| Show BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| Eq BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinString -> BuiltinString -> Bool Source # (/=) :: BuiltinString -> BuiltinString -> Bool Source # | |||||
| Ord BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinString -> BuiltinString -> Ordering Source # (<) :: BuiltinString -> BuiltinString -> Bool Source # (<=) :: BuiltinString -> BuiltinString -> Bool Source # (>) :: BuiltinString -> BuiltinString -> Bool Source # (>=) :: BuiltinString -> BuiltinString -> Bool Source # max :: BuiltinString -> BuiltinString -> BuiltinString Source # min :: BuiltinString -> BuiltinString -> BuiltinString Source # | |||||
| HasBlueprintDefinition BuiltinString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinString -> FromBuiltin BuiltinString Source # | |||||
| Eq BuiltinString Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinString -> BuiltinString -> Bool Source # | |||||
| Monoid BuiltinString Source # | |||||
Defined in PlutusTx.Monoid Methods | |||||
| Semigroup BuiltinString Source # | |||||
Defined in PlutusTx.Semigroup Methods (<>) :: BuiltinString -> BuiltinString -> BuiltinString Source # | |||||
| Show BuiltinString Source # | |||||
Defined in PlutusTx.Show Methods showsPrec :: Integer -> BuiltinString -> ShowS Source # show :: BuiltinString -> BuiltinString Source # | |||||
| HasBlueprintSchema BuiltinString referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque BuiltinString BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasToOpaque BuiltinString BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasTermLevel uni Text => Lift uni BuiltinString Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinString -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni Text => Typeable uni BuiltinString Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type Unroll BuiltinString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
appendString :: BuiltinString -> BuiltinString -> BuiltinString Source #
Append two Strings.
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
Booleans
module PlutusTx.Bool
Integer numbers
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 IP and IN constructors are used to store a BigNat
representing respectively the positive or the negative value magnitude.
Instances
| FromJSON Integer | |||||||||||||
Defined in Data.Aeson.Types.FromJSON | |||||||||||||
| FromJSONKey Integer | |||||||||||||
Defined in Data.Aeson.Types.FromJSON | |||||||||||||
| ToJSON Integer | |||||||||||||
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: Integer -> Encoding toJSONList :: [Integer] -> Value toEncodingList :: [Integer] -> Encoding | |||||||||||||
| ToJSONKey Integer | |||||||||||||
Defined in Data.Aeson.Types.ToJSON | |||||||||||||
| Data Integer | Since: base-4.0.0.0 | ||||||||||||
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 # | |||||||||||||
| Bits Integer | Since: base-2.1 | ||||||||||||
Defined in GHC.Bits Methods (.&.) :: Integer -> Integer -> Integer Source # (.|.) :: Integer -> Integer -> Integer Source # xor :: Integer -> Integer -> Integer Source # complement :: Integer -> Integer Source # shift :: Integer -> Int -> Integer Source # rotate :: Integer -> Int -> Integer Source # bit :: Int -> Integer Source # setBit :: Integer -> Int -> Integer Source # clearBit :: Integer -> Int -> Integer Source # complementBit :: Integer -> Int -> Integer Source # testBit :: Integer -> Int -> Bool Source # bitSizeMaybe :: Integer -> Maybe Int Source # bitSize :: Integer -> Int Source # isSigned :: Integer -> Bool Source # shiftL :: Integer -> Int -> Integer Source # unsafeShiftL :: Integer -> Int -> Integer Source # shiftR :: Integer -> Int -> Integer Source # unsafeShiftR :: Integer -> Int -> Integer Source # rotateL :: Integer -> Int -> Integer Source # | |||||||||||||
| Enum Integer | Since: base-2.1 | ||||||||||||
Defined in GHC.Enum Methods succ :: Integer -> Integer Source # pred :: Integer -> Integer Source # toEnum :: Int -> Integer Source # fromEnum :: Integer -> Int Source # enumFrom :: Integer -> [Integer] Source # enumFromThen :: Integer -> Integer -> [Integer] Source # enumFromTo :: Integer -> Integer -> [Integer] Source # enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] Source # | |||||||||||||
| Ix Integer | Since: base-2.1 | ||||||||||||
| Num Integer | Since: base-2.1 | ||||||||||||
Defined in GHC.Num | |||||||||||||
| Read Integer | Since: base-2.1 | ||||||||||||
| Integral Integer | Since: base-2.0.1 | ||||||||||||
Defined in GHC.Real Methods quot :: Integer -> Integer -> Integer Source # rem :: Integer -> Integer -> Integer Source # div :: Integer -> Integer -> Integer Source # mod :: Integer -> Integer -> Integer Source # quotRem :: Integer -> Integer -> (Integer, Integer) Source # | |||||||||||||
| Real Integer | Since: base-2.0.1 | ||||||||||||
| Show Integer | Since: base-2.1 | ||||||||||||
| PrintfArg Integer | Since: base-2.1 | ||||||||||||
Defined in Text.Printf Methods formatArg :: Integer -> FieldFormatter Source # parseFormat :: Integer -> ModifierParser Source # | |||||||||||||
| Subtractive Integer | |||||||||||||
Defined in Basement.Numerical.Subtractive Associated Types
| |||||||||||||
| Default Integer | |||||||||||||
Defined in Data.Default.Internal | |||||||||||||
| NFData Integer | |||||||||||||
Defined in Control.DeepSeq | |||||||||||||
| Buildable Integer | |||||||||||||
Defined in Formatting.Buildable | |||||||||||||
| Eq Integer | |||||||||||||
| Ord Integer | |||||||||||||
| Hashable Integer | |||||||||||||
Defined in Data.Hashable.Class | |||||||||||||
| ExMemoryUsage Integer | |||||||||||||
Defined in PlutusCore.Evaluation.Machine.ExMemoryUsage Methods memoryUsage :: Integer -> CostRose | |||||||||||||
| HasBlueprintDefinition Integer Source # | |||||||||||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||||||||||
| HasFromBuiltin BuiltinInteger Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinInteger -> FromBuiltin BuiltinInteger Source # | |||||||||||||
| HasToBuiltin Integer Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||||||||||
| MkNil BuiltinInteger Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||||||||||
| Enum Integer Source # | |||||||||||||
Defined in PlutusTx.Enum.Class | |||||||||||||
| Eq Integer Source # | |||||||||||||
| FromData Integer Source # | |||||||||||||
Defined in PlutusTx.IsData.Class Methods | |||||||||||||
| ToData Integer Source # | |||||||||||||
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: Integer -> BuiltinData Source # | |||||||||||||
| UnsafeFromData Integer Source # | |||||||||||||
Defined in PlutusTx.IsData.Class Methods | |||||||||||||
| AdditiveGroup Integer Source # | |||||||||||||
| AdditiveMonoid Integer Source # | |||||||||||||
Defined in PlutusTx.Numeric | |||||||||||||
| AdditiveSemigroup Integer Source # | |||||||||||||
| MultiplicativeMonoid Integer Source # | |||||||||||||
Defined in PlutusTx.Numeric | |||||||||||||
| MultiplicativeSemigroup Integer Source # | |||||||||||||
| Ord Integer Source # | |||||||||||||
Defined in PlutusTx.Ord.Class | |||||||||||||
| Show Integer Source # | |||||||||||||
| Pretty Integer | |||||||||||||
Defined in Prettyprinter.Internal | |||||||||||||
| UniformRange Integer | |||||||||||||
| Serialise Integer | |||||||||||||
Defined in Codec.Serialise.Class | |||||||||||||
| Pretty Rational | |||||||||||||
Defined in Text.PrettyPrint.Annotated.WL | |||||||||||||
| Pretty Integer | |||||||||||||
Defined in Text.PrettyPrint.Annotated.WL | |||||||||||||
| ZigZag Integer Natural | |||||||||||||
| HasBlueprintSchema Integer referencedTypes Source # | |||||||||||||
Defined in PlutusTx.Blueprint.Class | |||||||||||||
| HasFromOpaque BuiltinInteger BuiltinInteger Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||||||||||
| HasToOpaque BuiltinInteger BuiltinInteger Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||||||||||
| HasTermLevel uni Integer => Lift uni BuiltinInteger Source # | |||||||||||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinInteger -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||||||||||
| Module Integer Rational Source # | |||||||||||||
| DefaultPrettyBy config Integer | |||||||||||||
Defined in Text.PrettyBy.Internal Methods defaultPrettyBy :: config -> Integer -> Doc ann defaultPrettyListBy :: config -> [Integer] -> Doc ann | |||||||||||||
| NonDefaultPrettyBy ConstConfig Integer | |||||||||||||
Defined in PlutusCore.Pretty.PrettyConst Methods nonDefaultPrettyBy :: ConstConfig -> Integer -> Doc ann nonDefaultPrettyListBy :: ConstConfig -> [Integer] -> Doc ann | |||||||||||||
| PrettyDefaultBy config Integer => PrettyBy config Integer | |||||||||||||
Defined in Text.PrettyBy.Internal | |||||||||||||
| Lift Integer | |||||||||||||
| KnownBuiltinTypeIn DefaultUni term Integer => MakeKnownIn DefaultUni term Integer | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| KnownBuiltinTypeIn DefaultUni term Integer => ReadKnownIn DefaultUni term Integer | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| Contains DefaultUni Integer | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| HasTypeLevel uni Integer => Typeable uni BuiltinInteger Source # | |||||||||||||
Defined in PlutusTx.Lift.Class | |||||||||||||
| KnownNat n => Reifies (n :: Nat) Integer | |||||||||||||
Defined in Data.Reflection | |||||||||||||
| KnownBuiltinTypeAst tyname DefaultUni Integer => KnownTypeAst tyname DefaultUni Integer | |||||||||||||
Defined in PlutusCore.Default.Universe Associated Types
Methods typeAst :: Type tyname DefaultUni () | |||||||||||||
| type Difference Integer | |||||||||||||
Defined in Basement.Numerical.Subtractive | |||||||||||||
| type Unroll Integer Source # | |||||||||||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||||||||||
| type FromBuiltin BuiltinInteger Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||||||||||
| type ToBuiltin Integer Source # | |||||||||||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||||||||||
| type IsBuiltin DefaultUni Integer | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| type ToBinds DefaultUni acc Integer | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
| type ToHoles DefaultUni hole Integer | |||||||||||||
Defined in PlutusCore.Default.Universe | |||||||||||||
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) 54
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
expMod :: Integer -> Integer -> Integer -> Integer Source #
Modular exponentiation, as defined in CIP-0109.
Maybe
module PlutusTx.Maybe
Either
module PlutusTx.Either
ByteStrings
data BuiltinByteString Source #
An opaque type representing Plutus Core ByteStrings.
Instances
| Data BuiltinByteString Source # | |||||
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 # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromString :: String -> BuiltinByteString Source # | |||||
| Monoid BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods mempty :: BuiltinByteString Source # mappend :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # mconcat :: [BuiltinByteString] -> BuiltinByteString Source # | |||||
| Semigroup BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (<>) :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # sconcat :: NonEmpty BuiltinByteString -> BuiltinByteString Source # stimes :: Integral b => b -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Show BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinByteString -> () Source # | |||||
| Eq BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (/=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # | |||||
| Ord BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinByteString -> BuiltinByteString -> Ordering Source # (<) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (<=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # max :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # min :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Hashable BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| ByteArray BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| ByteArrayAccess BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods length :: BuiltinByteString -> Int withByteArray :: BuiltinByteString -> (Ptr p -> IO a) -> IO a copyByteArrayToPtr :: BuiltinByteString -> Ptr p -> IO () | |||||
| HasBlueprintDefinition BuiltinByteString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinByteString -> FromBuiltin BuiltinByteString Source # | |||||
| MkNil BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinByteString Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinByteString -> BuiltinByteString -> Bool Source # | |||||
| FromData BuiltinByteString Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinByteString Source # | |||||
| ToData BuiltinByteString Source # | |||||
Defined in PlutusTx.IsData.Class Methods | |||||
| UnsafeFromData BuiltinByteString Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinByteString Source # | |||||
| Monoid BuiltinByteString Source # | |||||
Defined in PlutusTx.Monoid Methods | |||||
| Ord BuiltinByteString Source # | |||||
Defined in PlutusTx.Ord.Class Methods compare :: BuiltinByteString -> BuiltinByteString -> Ordering Source # (<) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (<=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # max :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # min :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Semigroup BuiltinByteString Source # | |||||
Defined in PlutusTx.Semigroup Methods (<>) :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Show BuiltinByteString Source # | |||||
Defined in PlutusTx.Show | |||||
| Pretty BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| Serialise BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods encode :: BuiltinByteString -> Encoding decode :: Decoder s BuiltinByteString encodeList :: [BuiltinByteString] -> Encoding decodeList :: Decoder s [BuiltinByteString] | |||||
| HasBlueprintSchema BuiltinByteString referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque BuiltinByteString BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinByteString -> BuiltinByteString Source # | |||||
| HasToOpaque BuiltinByteString BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasTermLevel uni ByteString => Lift uni BuiltinByteString Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinByteString -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni ByteString => Typeable uni BuiltinByteString Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type Unroll BuiltinByteString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #
Concatenates two ByteStrings.
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.
newtype BuiltinByteStringUtf8 Source #
Constructors
| BuiltinByteStringUtf8 | |
Fields | |
Instances
| IsString BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque Methods | |
| Monoid BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque | |
| Semigroup BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque Methods (<>) :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 Source # sconcat :: NonEmpty BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 Source # stimes :: Integral b => b -> BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 Source # | |
| Show BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque | |
| NFData BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque Methods rnf :: BuiltinByteStringUtf8 -> () Source # | |
| Eq BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque Methods (==) :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> Bool Source # (/=) :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> Bool Source # | |
| Ord BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque Methods compare :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> Ordering Source # (<) :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> Bool Source # (<=) :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> Bool Source # (>) :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> Bool Source # (>=) :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> Bool Source # max :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 Source # min :: BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 -> BuiltinByteStringUtf8 Source # | |
| Hashable BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque | |
| ByteArray BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque | |
| ByteArrayAccess BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque Methods length :: BuiltinByteStringUtf8 -> Int withByteArray :: BuiltinByteStringUtf8 -> (Ptr p -> IO a) -> IO a copyByteArrayToPtr :: BuiltinByteStringUtf8 -> Ptr p -> IO () | |
| Pretty BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque | |
| Serialise BuiltinByteStringUtf8 Source # | |
Defined in PlutusTx.Builtins.HasOpaque Methods encode :: BuiltinByteStringUtf8 -> Encoding decode :: Decoder s BuiltinByteStringUtf8 encodeList :: [BuiltinByteStringUtf8] -> Encoding decodeList :: Decoder s [BuiltinByteStringUtf8] | |
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
bisTrue, 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
replicateByte :: Integer -> Integer -> BuiltinByteString Source #
Given a length (first argument) and a byte (second argument), produce a BuiltinByteString of
that length, with that byte in every position. Will error if given a negative length, or a second
argument that isn't a byte (less than 0, greater than 255).
See also
shiftByteString :: BuiltinByteString -> Integer -> BuiltinByteString Source #
Shift a BuiltinByteString, as per
CIP-123.
rotateByteString :: BuiltinByteString -> Integer -> BuiltinByteString Source #
Rotate a BuiltinByteString, as per
CIP-123.
countSetBits :: BuiltinByteString -> Integer Source #
Count the set bits in a BuiltinByteString, as per
CIP-123.
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
0x02if y is even, and0x03otherwise. - 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
secp256k1_ec_pubkey_serialize; this implements the format for the verification key that we accept, given a length argument of 33 and theSECP256K1_EC_COMPRESSEDflag.secp256k1_ecdsa_serialize_compact; this implements the format for the signature that we accept.
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
- BIP-340
secp256k1_xonly_pubkey_serialize; this implements the format for the verification key that we accept.secp256k1_schnorrsig_sign; this implements the signing logic for signatures this builtin can verify.
Rational numbers
Represents an arbitrary-precision ratio.
The following two invariants are maintained:
- The denominator is greater than zero.
- The numerator and denominator are coprime.
Instances
| FromJSON Rational Source # | This mimics the behaviour of Aeson's instance for | ||||
Defined in PlutusTx.Ratio | |||||
| ToJSON Rational Source # | This mimics the behaviour of Aeson's instance for | ||||
Defined in PlutusTx.Ratio Methods toEncoding :: Rational -> Encoding toJSONList :: [Rational] -> Value toEncodingList :: [Rational] -> Encoding | |||||
| Generic Rational Source # | |||||
Defined in PlutusTx.Ratio Associated Types
| |||||
| Show Rational Source # | |||||
| Eq Rational Source # | |||||
| Ord Rational Source # | |||||
Defined in PlutusTx.Ratio | |||||
| HasBlueprintDefinition Rational Source # | |||||
| Enum Rational Source # | |||||
Defined in PlutusTx.Ratio | |||||
| Eq Rational Source # | |||||
| FromData Rational Source # | |||||
Defined in PlutusTx.Ratio Methods | |||||
| ToData Rational Source # | |||||
Defined in PlutusTx.Ratio Methods toBuiltinData :: Rational -> BuiltinData Source # | |||||
| UnsafeFromData Rational Source # | |||||
Defined in PlutusTx.Ratio Methods | |||||
| AdditiveGroup Rational Source # | |||||
| AdditiveMonoid Rational Source # | |||||
Defined in PlutusTx.Ratio | |||||
| AdditiveSemigroup Rational Source # | |||||
| MultiplicativeMonoid Rational Source # | |||||
Defined in PlutusTx.Ratio | |||||
| MultiplicativeSemigroup Rational Source # | |||||
| Ord Rational Source # | |||||
Defined in PlutusTx.Ratio | |||||
| Pretty Rational Source # | |||||
Defined in PlutusTx.Ratio | |||||
| HasSchemaDefinition Integer referencedTypes => HasBlueprintSchema Rational referencedTypes Source # | |||||
Defined in PlutusTx.Ratio | |||||
| Lift DefaultUni Rational Source # | |||||
| Module Integer Rational Source # | |||||
| Typeable DefaultUni Rational Source # | |||||
| type Rep Rational Source # | |||||
Defined in PlutusTx.Ratio type Rep Rational = D1 ('MetaData "Rational" "PlutusTx.Ratio" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" '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 # | |||||
Defined in PlutusTx.Ratio | |||||
ratio :: Integer -> Integer -> Maybe Rational Source #
Safely constructs a Rational from a numerator and a denominator. Returns
Nothing if given a zero denominator.
Other builtin Types
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
| Data BuiltinData Source # | |||||
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 # | |||||
Defined in PlutusTx.Builtins.Internal Associated Types
Methods from :: BuiltinData -> Rep BuiltinData x Source # to :: Rep BuiltinData x -> BuiltinData Source # | |||||
| Show BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinData -> () Source # | |||||
| Eq BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinData -> BuiltinData -> Bool Source # (/=) :: BuiltinData -> BuiltinData -> Bool Source # | |||||
| Ord BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinData -> BuiltinData -> Ordering Source # (<) :: BuiltinData -> BuiltinData -> Bool Source # (<=) :: BuiltinData -> BuiltinData -> Bool Source # (>) :: BuiltinData -> BuiltinData -> Bool Source # (>=) :: BuiltinData -> BuiltinData -> Bool Source # max :: BuiltinData -> BuiltinData -> BuiltinData Source # min :: BuiltinData -> BuiltinData -> BuiltinData Source # | |||||
| HasBlueprintDefinition BuiltinData Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinData -> FromBuiltin BuiltinData Source # | |||||
| MkNil BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinData Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinData -> BuiltinData -> Bool Source # | |||||
| FromData BuiltinData Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinData Source # | |||||
| ToData BuiltinData Source # | |||||
Defined in PlutusTx.IsData.Class Methods | |||||
| UnsafeFromData BuiltinData Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinData Source # | |||||
| Show BuiltinData Source # | |||||
Defined in PlutusTx.Show Methods showsPrec :: Integer -> BuiltinData -> ShowS Source # show :: BuiltinData -> BuiltinString Source # | |||||
| Pretty BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| HasBlueprintSchema BuiltinData referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque BuiltinData BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinData -> BuiltinData Source # | |||||
| HasToOpaque BuiltinData BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: BuiltinData -> BuiltinData Source # | |||||
| HasTermLevel uni Data => Lift uni BuiltinData Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinData -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni Data => Typeable uni BuiltinData Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: (BuiltinData, BuiltinData) -> BuiltinPair BuiltinData BuiltinData Source # | |||||
| type Rep BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal type Rep BuiltinData = D1 ('MetaData "BuiltinData" "PlutusTx.Builtins.Internal" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" 'False) (C1 ('MetaCons "BuiltinData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Data))) | |||||
| type Unroll BuiltinData Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
data BuiltinList a Source #
Instances
| (HasFromBuiltin arep, HasTermLevel uni [FromBuiltin arep]) => Lift uni (BuiltinList arep) Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinList arep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| Data a => Data (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinList a -> c (BuiltinList a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinList a) Source # toConstr :: BuiltinList a -> Constr Source # dataTypeOf :: BuiltinList a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinList a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinList a)) Source # gmapT :: (forall b. Data b => b -> b) -> BuiltinList a -> BuiltinList a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinList a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinList a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinList a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinList a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source # | |||||
| Show a => Show (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| Eq a => Eq (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinList a -> BuiltinList a -> Bool Source # (/=) :: BuiltinList a -> BuiltinList a -> Bool Source # | |||||
| Ord a => Ord (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinList a -> BuiltinList a -> Ordering Source # (<) :: BuiltinList a -> BuiltinList a -> Bool Source # (<=) :: BuiltinList a -> BuiltinList a -> Bool Source # (>) :: BuiltinList a -> BuiltinList a -> Bool Source # (>=) :: BuiltinList a -> BuiltinList a -> Bool Source # max :: BuiltinList a -> BuiltinList a -> BuiltinList a Source # min :: BuiltinList a -> BuiltinList a -> BuiltinList a Source # | |||||
| HasBlueprintDefinition a => HasBlueprintDefinition (BuiltinList a) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin a => HasFromBuiltin (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinList a -> FromBuiltin (BuiltinList a) Source # | |||||
| MkNil a => MkNil (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods mkNil :: BuiltinList (BuiltinList a) Source # | |||||
| HasBlueprintSchema a referencedTypes => HasBlueprintSchema (BuiltinList a) referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque arep a => HasFromOpaque (BuiltinList arep) [a] Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinList arep -> [a] Source # | |||||
| (HasToOpaque a arep, MkNil arep) => HasToOpaque [a] (BuiltinList arep) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: [a] -> BuiltinList arep Source # | |||||
| HasTypeLevel uni [] => Typeable uni BuiltinList Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type Unroll (BuiltinList a) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
data BuiltinPair a b Source #
Instances
| (HasFromBuiltin arep, HasFromBuiltin brep, HasTermLevel uni (FromBuiltin arep, FromBuiltin brep)) => Lift uni (BuiltinPair arep brep) Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinPair arep brep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| (Data a, Data b) => Data (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> BuiltinPair a b -> c (BuiltinPair a b) Source # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinPair a b) Source # toConstr :: BuiltinPair a b -> Constr Source # dataTypeOf :: BuiltinPair a b -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinPair a b)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinPair a b)) Source # gmapT :: (forall b0. Data b0 => b0 -> b0) -> BuiltinPair a b -> BuiltinPair a b Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinPair a b -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinPair a b -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinPair a b -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinPair a b -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source # | |||||
| (Show a, Show b) => Show (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| (Eq a, Eq b) => Eq (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (/=) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # | |||||
| (Ord a, Ord b) => Ord (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinPair a b -> BuiltinPair a b -> Ordering Source # (<) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (<=) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (>) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (>=) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # max :: BuiltinPair a b -> BuiltinPair a b -> BuiltinPair a b Source # min :: BuiltinPair a b -> BuiltinPair a b -> BuiltinPair a b Source # | |||||
| (HasBlueprintDefinition a, HasBlueprintDefinition b) => HasBlueprintDefinition (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| (HasFromBuiltin a, HasFromBuiltin b) => HasFromBuiltin (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinPair a b -> FromBuiltin (BuiltinPair a b) Source # | |||||
| (MkNil a, MkNil b) => MkNil (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods mkNil :: BuiltinList (BuiltinPair a b) Source # | |||||
| (HasBlueprintSchema a referencedTypes, HasBlueprintSchema b referencedTypes) => HasBlueprintSchema (BuiltinPair a b) referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasTypeLevel uni (,) => Typeable uni BuiltinPair Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| (HasFromOpaque arep a, HasFromOpaque brep b) => HasFromOpaque (BuiltinPair arep brep) (a, b) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinPair arep brep -> (a, b) Source # | |||||
| HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: (BuiltinData, BuiltinData) -> BuiltinPair BuiltinData BuiltinData Source # | |||||
| type Unroll (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
To/from Data
A typeclass for types that can be converted to and from BuiltinData.
Instances
| ToData Void Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: Void -> BuiltinData Source # | |
| ToData BuiltinBLS12_381_G1_Element Source # | For the BLS12-381 G1 and G2 types we use the |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G1_Element -> BuiltinData Source # | |
| ToData BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G2_Element -> BuiltinData Source # | |
| (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. |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_MlResult -> BuiltinData Source # | |
| ToData BuiltinByteString Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| ToData BuiltinData Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| ToData Rational Source # | |
Defined in PlutusTx.Ratio Methods toBuiltinData :: Rational -> BuiltinData Source # | |
| ToData Sqrt Source # | |
Defined in PlutusTx.Sqrt Methods toBuiltinData :: Sqrt -> BuiltinData Source # | |
| ToData Integer Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: Integer -> BuiltinData Source # | |
| ToData () Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: () -> BuiltinData Source # | |
| ToData Bool Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: Bool -> BuiltinData Source # | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => ToData Int Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: Int -> BuiltinData Source # | |
| ToData (List a) Source # | |
Defined in PlutusTx.Data.List Methods toBuiltinData :: List a -> BuiltinData Source # | |
| ToData a => ToData (Maybe a) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: Maybe a -> BuiltinData Source # | |
| ToData a => ToData [a] Source # | |
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: [a] -> BuiltinData Source # | |
| (ToData a, ToData b) => ToData (Either a b) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: Either a b -> BuiltinData Source # | |
| (ToData k, ToData v) => ToData (Map k v) Source # | Hand-written instances to use the underlying |
Defined in PlutusTx.AssocMap Methods toBuiltinData :: Map k v -> BuiltinData Source # | |
| ToData (Map k a) Source # | |
Defined in PlutusTx.Data.AssocMap Methods toBuiltinData :: Map k a -> BuiltinData Source # | |
| (ToData a, ToData b) => ToData (These a b) Source # | |
Defined in PlutusTx.These Methods toBuiltinData :: These a b -> BuiltinData Source # | |
| (ToData a, ToData b) => ToData (a, b) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: (a, b) -> BuiltinData Source # | |
| (ToData a, ToData b, ToData c) => ToData (a, b, c) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: (a, b, c) -> BuiltinData Source # | |
| (ToData a, ToData b, ToData c, ToData d) => ToData (a, b, c, d) Source # | |
Defined in PlutusTx.IsData.Instances Methods toBuiltinData :: (a, b, c, d) -> BuiltinData Source # | |
class FromData a where Source #
Methods
fromBuiltinData :: BuiltinData -> Maybe a Source #
Convert a value from BuiltinData, returning Nothing if this fails.
Instances
| FromData Void Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe Void Source # | |
| FromData BuiltinBLS12_381_G1_Element Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G1_Element Source # | |
| FromData BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G2_Element Source # | |
| (TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => FromData BuiltinBLS12_381_MlResult Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_MlResult Source # | |
| FromData BuiltinByteString Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinByteString Source # | |
| FromData BuiltinData Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinData Source # | |
| FromData Rational Source # | |
Defined in PlutusTx.Ratio Methods | |
| FromData Sqrt Source # | |
Defined in PlutusTx.Sqrt Methods fromBuiltinData :: BuiltinData -> Maybe Sqrt Source # | |
| FromData Integer Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| FromData () Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe () Source # | |
| FromData Bool Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe Bool Source # | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => FromData Int Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe Int Source # | |
| FromData (List a) Source # | |
Defined in PlutusTx.Data.List Methods fromBuiltinData :: BuiltinData -> Maybe (List a) Source # | |
| FromData a => FromData (Maybe a) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (Maybe a) Source # | |
| FromData a => FromData [a] Source # | |
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe [a] Source # | |
| (FromData a, FromData b) => FromData (Either a b) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (Either a b) Source # | |
| (FromData k, FromData v) => FromData (Map k v) Source # | A hand-written transformation from |
Defined in PlutusTx.AssocMap Methods fromBuiltinData :: BuiltinData -> Maybe (Map k v) Source # | |
| FromData (Map k a) Source # | |
Defined in PlutusTx.Data.AssocMap Methods fromBuiltinData :: BuiltinData -> Maybe (Map k a) Source # | |
| (FromData a, FromData b) => FromData (These a b) Source # | |
Defined in PlutusTx.These Methods fromBuiltinData :: BuiltinData -> Maybe (These a b) Source # | |
| (FromData a, FromData b) => FromData (a, b) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (a, b) Source # | |
| (FromData a, FromData b, FromData c) => FromData (a, b, c) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (a, b, c) Source # | |
| (FromData a, FromData b, FromData c, FromData d) => FromData (a, b, c, d) Source # | |
Defined in PlutusTx.IsData.Instances Methods fromBuiltinData :: BuiltinData -> Maybe (a, b, c, d) Source # | |
class UnsafeFromData a where Source #
Methods
unsafeFromBuiltinData :: BuiltinData -> a Source #
Convert a value from BuiltinData, calling error if this fails.
This is typically much faster than fromBuiltinData.
When implementing this function, make sure to call unsafeFromBuiltinData
rather than fromBuiltinData when converting substructures!
This is a simple type without any validation, use with caution.
Instances
| UnsafeFromData Void Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| UnsafeFromData BuiltinBLS12_381_G1_Element Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G1_Element Source # | |
| UnsafeFromData BuiltinBLS12_381_G2_Element Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G2_Element Source # | |
| (TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => UnsafeFromData BuiltinBLS12_381_MlResult Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_MlResult Source # | |
| UnsafeFromData BuiltinByteString Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinByteString Source # | |
| UnsafeFromData BuiltinData Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinData Source # | |
| UnsafeFromData Rational Source # | |
Defined in PlutusTx.Ratio Methods | |
| UnsafeFromData Sqrt Source # | |
Defined in PlutusTx.Sqrt Methods | |
| UnsafeFromData Integer Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| UnsafeFromData () Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> () Source # | |
| UnsafeFromData Bool Source # | |
Defined in PlutusTx.IsData.Instances Methods | |
| (TypeError ('Text "Int is not supported, use Integer instead") :: Constraint) => UnsafeFromData Int Source # | |
Defined in PlutusTx.IsData.Class Methods | |
| UnsafeFromData (List a) Source # | |
Defined in PlutusTx.Data.List Methods unsafeFromBuiltinData :: BuiltinData -> List a Source # | |
| UnsafeFromData a => UnsafeFromData (Maybe a) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> Maybe a Source # | |
| UnsafeFromData a => UnsafeFromData [a] Source # | |
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> [a] Source # | |
| (UnsafeFromData a, UnsafeFromData b) => UnsafeFromData (Either a b) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> Either a b Source # | |
| (UnsafeFromData k, UnsafeFromData v) => UnsafeFromData (Map k v) Source # | A hand-written transformation from |
Defined in PlutusTx.AssocMap Methods unsafeFromBuiltinData :: BuiltinData -> Map k v Source # | |
| UnsafeFromData (Map k a) Source # | |
Defined in PlutusTx.Data.AssocMap Methods unsafeFromBuiltinData :: BuiltinData -> Map k a Source # | |
| (UnsafeFromData a, UnsafeFromData b) => UnsafeFromData (These a b) Source # | |
Defined in PlutusTx.These Methods unsafeFromBuiltinData :: BuiltinData -> These a b Source # | |
| (UnsafeFromData a, UnsafeFromData b) => UnsafeFromData (a, b) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> (a, b) Source # | |
| (UnsafeFromData a, UnsafeFromData b, UnsafeFromData c) => UnsafeFromData (a, b, c) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> (a, b, c) Source # | |
| (UnsafeFromData a, UnsafeFromData b, UnsafeFromData c, UnsafeFromData d) => UnsafeFromData (a, b, c, d) Source # | |
Defined in PlutusTx.IsData.Instances Methods unsafeFromBuiltinData :: BuiltinData -> (a, b, c, d) Source # | |
BLS12_381
data BuiltinBLS12_381_G1_Element Source #
Instances
| Show BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinBLS12_381_G1_Element -> () Source # | |||||
| Eq BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source # (/=) :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source # | |||||
| HasFromBuiltin BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||
| MkNil BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source # | |||||
| FromData BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G1_Element Source # | |||||
| ToData BuiltinBLS12_381_G1_Element Source # | For the BLS12-381 G1 and G2 types we use the | ||||
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G1_Element -> BuiltinData Source # | |||||
| UnsafeFromData BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G1_Element Source # | |||||
| Pretty BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods pretty :: BuiltinBLS12_381_G1_Element -> Doc ann prettyList :: [BuiltinBLS12_381_G1_Element] -> Doc ann | |||||
| HasFromOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasToOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G1_Element Source # | |||||
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 # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type FromBuiltin BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
bls12_381_G1_add :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #
bls12_381_G1_scalarMul :: Integer -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #
bls12_381_G1_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G1_Element Source #
data BuiltinBLS12_381_G2_Element Source #
Instances
| Show BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinBLS12_381_G2_Element -> () Source # | |||||
| Eq BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source # (/=) :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source # | |||||
| HasFromBuiltin BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||
| MkNil BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source # | |||||
| FromData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G2_Element Source # | |||||
| ToData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G2_Element -> BuiltinData Source # | |||||
| UnsafeFromData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G2_Element Source # | |||||
| Pretty BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods pretty :: BuiltinBLS12_381_G2_Element -> Doc ann prettyList :: [BuiltinBLS12_381_G2_Element] -> Doc ann | |||||
| HasFromOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasToOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G2_Element Source # | |||||
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 # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type FromBuiltin BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
bls12_381_G2_add :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #
bls12_381_G2_scalarMul :: Integer -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #
bls12_381_G2_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G2_Element Source #
data BuiltinBLS12_381_MlResult Source #
Instances
| Show BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinBLS12_381_MlResult -> () Source # | |||||
| Eq BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool Source # (/=) :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool Source # | |||||
| HasFromBuiltin BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||
| (TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => FromData BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_MlResult Source # | |||||
| (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. | ||||
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_MlResult -> BuiltinData Source # | |||||
| (TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => UnsafeFromData BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_MlResult Source # | |||||
| Pretty BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods pretty :: BuiltinBLS12_381_MlResult -> Doc ann prettyList :: [BuiltinBLS12_381_MlResult] -> Doc ann | |||||
| HasFromOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult Source # | |||||
| HasToOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult Source # | |||||
| HasTermLevel uni MlResult => Lift uni BuiltinBLS12_381_MlResult Source # | |||||
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 # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type FromBuiltin BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
bls12_381_millerLoop :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_MlResult Source #
bls12_381_mulMlResult :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult Source #
Conversions
fromBuiltin :: HasFromBuiltin arep => arep -> FromBuiltin arep Source #
toBuiltin :: HasToBuiltin a => a -> ToBuiltin a Source #
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.