Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains the special Haskell names that are used to map to builtin types or functions in Plutus Core.
Most users should not use this module directly, but rather use Builtins
.
Synopsis
- error :: BuiltinUnit -> a
- data BuiltinBool = BuiltinBool ~Bool
- true :: BuiltinBool
- false :: BuiltinBool
- ifThenElse :: BuiltinBool -> a -> a -> a
- data BuiltinUnit = BuiltinUnit ~()
- unitval :: BuiltinUnit
- chooseUnit :: BuiltinUnit -> a -> a
- type BuiltinInteger = Integer
- addInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- subtractInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- multiplyInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- divideInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- modInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- quotientInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- remainderInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- lessThanInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinBool
- lessThanEqualsInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinBool
- equalsInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinBool
- data BuiltinByteString = BuiltinByteString ~ByteString
- appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- consByteString :: BuiltinInteger -> BuiltinByteString -> BuiltinByteString
- sliceByteString :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString -> BuiltinByteString
- lengthOfByteString :: BuiltinByteString -> BuiltinInteger
- indexByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinInteger
- emptyByteString :: BuiltinByteString
- 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 -> BuiltinBool
- verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool
- verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool
- traceAll :: forall (a :: Type) (f :: Type -> Type). Foldable f => f Text -> a -> a
- equalsByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinBool
- lessThanByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinBool
- lessThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinBool
- decodeUtf8 :: BuiltinByteString -> BuiltinString
- data BuiltinString = BuiltinString ~Text
- appendString :: BuiltinString -> BuiltinString -> BuiltinString
- emptyString :: BuiltinString
- equalsString :: BuiltinString -> BuiltinString -> BuiltinBool
- trace :: BuiltinString -> a -> a
- encodeUtf8 :: BuiltinString -> BuiltinByteString
- data BuiltinPair a b = BuiltinPair ~(a, b)
- fst :: BuiltinPair a b -> a
- snd :: BuiltinPair a b -> b
- mkPairData :: BuiltinData -> BuiltinData -> BuiltinPair BuiltinData BuiltinData
- data BuiltinList a = BuiltinList ~[a]
- null :: BuiltinList a -> BuiltinBool
- head :: BuiltinList a -> a
- tail :: BuiltinList a -> BuiltinList a
- chooseList :: BuiltinList a -> b -> b -> b
- mkNilData :: BuiltinUnit -> BuiltinList BuiltinData
- mkNilPairData :: BuiltinUnit -> BuiltinList (BuiltinPair BuiltinData BuiltinData)
- mkCons :: a -> BuiltinList a -> BuiltinList a
- data BuiltinData = BuiltinData ~Data
- builtinDataToData :: BuiltinData -> Data
- dataToBuiltinData :: Data -> BuiltinData
- chooseData :: forall a. BuiltinData -> a -> a -> a -> a -> a -> a
- mkConstr :: BuiltinInteger -> BuiltinList BuiltinData -> BuiltinData
- mkMap :: BuiltinList (BuiltinPair BuiltinData BuiltinData) -> BuiltinData
- mkList :: BuiltinList BuiltinData -> BuiltinData
- mkI :: BuiltinInteger -> BuiltinData
- mkB :: BuiltinByteString -> BuiltinData
- unsafeDataAsConstr :: BuiltinData -> BuiltinPair BuiltinInteger (BuiltinList BuiltinData)
- unsafeDataAsMap :: BuiltinData -> BuiltinList (BuiltinPair BuiltinData BuiltinData)
- unsafeDataAsList :: BuiltinData -> BuiltinList BuiltinData
- unsafeDataAsI :: BuiltinData -> BuiltinInteger
- unsafeDataAsB :: BuiltinData -> BuiltinByteString
- equalsData :: BuiltinData -> BuiltinData -> BuiltinBool
- serialiseData :: BuiltinData -> BuiltinByteString
- data BuiltinBLS12_381_G1_Element = BuiltinBLS12_381_G1_Element ~Element
- bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBool
- 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 :: BuiltinInteger -> 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 = BuiltinBLS12_381_G2_Element ~Element
- bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBool
- 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 :: BuiltinInteger -> 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 = BuiltinBLS12_381_MlResult ~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 -> BuiltinBool
- integerToByteString :: BuiltinBool -> BuiltinInteger -> BuiltinInteger -> BuiltinByteString
- byteStringToInteger :: BuiltinBool -> BuiltinByteString -> BuiltinInteger
- shiftByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString
- rotateByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString
- countSetBits :: BuiltinByteString -> BuiltinInteger
- findFirstSetBit :: BuiltinByteString -> BuiltinInteger
- andByteString :: BuiltinBool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- orByteString :: BuiltinBool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- xorByteString :: BuiltinBool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- complementByteString :: BuiltinByteString -> BuiltinByteString
- readBit :: BuiltinByteString -> BuiltinInteger -> BuiltinBool
- writeBits :: BuiltinByteString -> BuiltinList BuiltinInteger -> BuiltinBool -> BuiltinByteString
- replicateByte :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString
- expModInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger -> BuiltinInteger
Documentation
error :: BuiltinUnit -> a Source #
data BuiltinBool Source #
Instances
true :: BuiltinBool Source #
false :: BuiltinBool Source #
ifThenElse :: BuiltinBool -> a -> a -> a Source #
data BuiltinUnit Source #
BuiltinUnit ~() |
Instances
chooseUnit :: BuiltinUnit -> a -> a Source #
type BuiltinInteger = Integer Source #
data BuiltinByteString Source #
An opaque type representing Plutus Core ByteStrings.
Instances
sliceByteString :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString -> BuiltinByteString Source #
verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool Source #
verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool Source #
verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> BuiltinBool Source #
data BuiltinString Source #
Instances
equalsString :: BuiltinString -> BuiltinString -> BuiltinBool Source #
trace :: BuiltinString -> a -> a Source #
data BuiltinPair a b Source #
BuiltinPair ~(a, b) |
Instances
fst :: BuiltinPair a b -> a Source #
snd :: BuiltinPair a b -> b Source #
data BuiltinList a Source #
BuiltinList ~[a] |
Instances
null :: BuiltinList a -> BuiltinBool Source #
head :: BuiltinList a -> a Source #
tail :: BuiltinList a -> BuiltinList a Source #
chooseList :: BuiltinList a -> b -> b -> b Source #
mkCons :: a -> BuiltinList a -> BuiltinList a Source #
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
builtinDataToData :: BuiltinData -> Data Source #
Convert a BuiltinData
into a Data
. Only works off-chain.
dataToBuiltinData :: Data -> BuiltinData Source #
Convert a Data
into a BuiltinData
. Only works off-chain.
chooseData :: forall a. BuiltinData -> a -> a -> a -> a -> a -> a Source #
mkI :: BuiltinInteger -> BuiltinData Source #
mkB :: BuiltinByteString -> BuiltinData Source #
equalsData :: BuiltinData -> BuiltinData -> BuiltinBool Source #
data BuiltinBLS12_381_G1_Element Source #
BuiltinBLS12_381_G1_Element ~Element |
Instances
bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBool Source #
bls12_381_G1_add :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #
bls12_381_G1_scalarMul :: BuiltinInteger -> 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 #
BuiltinBLS12_381_G2_Element ~Element |
Instances
bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBool Source #
bls12_381_G2_add :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #
bls12_381_G2_scalarMul :: BuiltinInteger -> 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 #
BuiltinBLS12_381_MlResult ~MlResult |
Instances
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 #
bls12_381_finalVerify :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBool Source #
integerToByteString :: BuiltinBool -> BuiltinInteger -> BuiltinInteger -> BuiltinByteString Source #
andByteString :: BuiltinBool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #
xorByteString :: BuiltinBool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #
readBit :: BuiltinByteString -> BuiltinInteger -> BuiltinBool Source #