Copyright | (C) MLabs 2025 |
---|---|
License | Apache 2.0 |
Maintainer | koz@mlabs.city, sean@mlabs.city |
Safe Haskell | None |
Language | Haskell2010 |
Covenant.Prim
Description
Contains definitions relating to Plutus primitive functions in Covenant programs.
Note
In the 1.0.0 release, we didn't include non-flat builtin types, specifically
pairs, lists and Data
. Thus, the primops that operate on, or produce, these
are not currently included.
Since: 1.0.0
Synopsis
- data OneArgFunc
- typeOneArgFunc :: OneArgFunc -> CompT AbstractTy
- data TwoArgFunc
- = AddInteger
- | SubtractInteger
- | MultiplyInteger
- | DivideInteger
- | QuotientInteger
- | RemainderInteger
- | ModInteger
- | EqualsInteger
- | LessThanInteger
- | LessThanEqualsInteger
- | AppendByteString
- | ConsByteString
- | IndexByteString
- | EqualsByteString
- | LessThanByteString
- | LessThanEqualsByteString
- | AppendString
- | EqualsString
- | ChooseUnit
- | Trace
- | BLS12_381_G1_add
- | BLS12_381_G1_scalarMul
- | BLS12_381_G1_equal
- | BLS12_381_G1_hashToGroup
- | BLS12_381_G2_add
- | BLS12_381_G2_scalarMul
- | BLS12_381_G2_equal
- | BLS12_381_G2_hashToGroup
- | BLS12_381_millerLoop
- | BLS12_381_mulMlResult
- | BLS12_381_finalVerify
- | ByteStringToInteger
- | ReadBit
- | ReplicateByte
- | ShiftByteString
- | RotateByteString
- typeTwoArgFunc :: TwoArgFunc -> CompT AbstractTy
- data ThreeArgFunc
- typeThreeArgFunc :: ThreeArgFunc -> CompT AbstractTy
Documentation
data OneArgFunc Source #
All one-argument primitives provided by Plutus.
Note
We exclude the MkNilData
and MkNilPairData
primitives from this list for
several reasons. For clarity, we list these below. Firstly, the reason why
these primitives still exist at all is historical: Plutus now has the ability
to directly 'lift' empty list constants into itself. Secondly, while these
primitives could still be used instead of direct lifts, there is never a
reason to prefer them, as they are less efficient than embedding a constant
directly. Thirdly, their naive typings would end up with overdetermined type
variables - consider the typing of MkNilData
:
forall a . () -> ![a]
For all of these reasons, we do not represent these primitives in the ASG.
Since: 1.0.0
Constructors
Instances
Arbitrary OneArgFunc Source # | Does not shrink. Since: 1.0.0 |
Defined in Covenant.Prim | |
Show OneArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim Methods showsPrec :: Int -> OneArgFunc -> ShowS # show :: OneArgFunc -> String # showList :: [OneArgFunc] -> ShowS # | |
Eq OneArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim | |
Ord OneArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim Methods compare :: OneArgFunc -> OneArgFunc -> Ordering # (<) :: OneArgFunc -> OneArgFunc -> Bool # (<=) :: OneArgFunc -> OneArgFunc -> Bool # (>) :: OneArgFunc -> OneArgFunc -> Bool # (>=) :: OneArgFunc -> OneArgFunc -> Bool # max :: OneArgFunc -> OneArgFunc -> OneArgFunc # min :: OneArgFunc -> OneArgFunc -> OneArgFunc # |
typeOneArgFunc :: OneArgFunc -> CompT AbstractTy Source #
Produce the type of a single-argument primop.
Since: 1.0.0
data TwoArgFunc Source #
All two-argument primitives provided by Plutus.
Since: 1.0.0
Constructors
Instances
Arbitrary TwoArgFunc Source # | Does not shrink. Since: 1.0.0 |
Defined in Covenant.Prim | |
Show TwoArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim Methods showsPrec :: Int -> TwoArgFunc -> ShowS # show :: TwoArgFunc -> String # showList :: [TwoArgFunc] -> ShowS # | |
Eq TwoArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim | |
Ord TwoArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim Methods compare :: TwoArgFunc -> TwoArgFunc -> Ordering # (<) :: TwoArgFunc -> TwoArgFunc -> Bool # (<=) :: TwoArgFunc -> TwoArgFunc -> Bool # (>) :: TwoArgFunc -> TwoArgFunc -> Bool # (>=) :: TwoArgFunc -> TwoArgFunc -> Bool # max :: TwoArgFunc -> TwoArgFunc -> TwoArgFunc # min :: TwoArgFunc -> TwoArgFunc -> TwoArgFunc # |
typeTwoArgFunc :: TwoArgFunc -> CompT AbstractTy Source #
Produce the type of a two-argument primop.
Since: 1.0.0
data ThreeArgFunc Source #
All three-argument primitives provided by Plutus.
Since: 1.0.0
Constructors
VerifyEd25519Signature | |
VerifyEcdsaSecp256k1Signature | |
VerifySchnorrSecp256k1Signature | |
IfThenElse | |
IntegerToByteString | ChooseList | CaseList |
AndByteString | |
OrByteString | |
XorByteString | |
ExpModInteger | WriteBits |
Instances
Arbitrary ThreeArgFunc Source # | Does not shrink. Since: 1.0.0 |
Defined in Covenant.Prim | |
Show ThreeArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim Methods showsPrec :: Int -> ThreeArgFunc -> ShowS # show :: ThreeArgFunc -> String # showList :: [ThreeArgFunc] -> ShowS # | |
Eq ThreeArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim | |
Ord ThreeArgFunc Source # | Since: 1.0.0 |
Defined in Covenant.Prim Methods compare :: ThreeArgFunc -> ThreeArgFunc -> Ordering # (<) :: ThreeArgFunc -> ThreeArgFunc -> Bool # (<=) :: ThreeArgFunc -> ThreeArgFunc -> Bool # (>) :: ThreeArgFunc -> ThreeArgFunc -> Bool # (>=) :: ThreeArgFunc -> ThreeArgFunc -> Bool # max :: ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc # min :: ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc # |
typeThreeArgFunc :: ThreeArgFunc -> CompT AbstractTy Source #
Produce the type of a three-argument primop.
Since: 1.0.0