{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
{-# OPTIONS_GHC -fno-ignore-interface-pragmas #-}
module PlutusTx.Builtins (
BuiltinByteString
, appendByteString
, consByteString
, sliceByteString
, lengthOfByteString
, indexByteString
, emptyByteString
, equalsByteString
, lessThanByteString
, lessThanEqualsByteString
, greaterThanByteString
, greaterThanEqualsByteString
, sha2_256
, sha3_256
, blake2b_256
, verifyEd25519Signature
, verifyEcdsaSecp256k1Signature
, verifySchnorrSecp256k1Signature
, decodeUtf8
, Integer
, addInteger
, subtractInteger
, multiplyInteger
, divideInteger
, modInteger
, quotientInteger
, remainderInteger
, greaterThanInteger
, greaterThanEqualsInteger
, lessThanInteger
, lessThanEqualsInteger
, equalsInteger
, error
, BuiltinData
, chooseData
, matchData
, matchData'
, equalsData
, serialiseData
, mkConstr
, mkMap
, mkList
, mkI
, mkB
, unsafeDataAsConstr
, unsafeDataAsMap
, unsafeDataAsList
, unsafeDataAsI
, unsafeDataAsB
, BI.builtinDataToData
, BI.dataToBuiltinData
, BuiltinString
, appendString
, emptyString
, equalsString
, encodeUtf8
, matchList
, trace
, fromBuiltin
, toBuiltin
) where
import PlutusTx.Base (const, uncurry)
import PlutusTx.Bool (Bool (..))
import PlutusTx.Builtins.Class
import PlutusTx.Builtins.Internal (BuiltinByteString (..), BuiltinData, BuiltinString)
import PlutusTx.Builtins.Internal qualified as BI
import PlutusTx.Integer (Integer)
{-# INLINABLE appendByteString #-}
appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString
appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString
appendByteString = BuiltinByteString -> BuiltinByteString -> BuiltinByteString
BI.appendByteString
{-# INLINABLE consByteString #-}
consByteString :: Integer -> BuiltinByteString -> BuiltinByteString
consByteString :: Integer -> BuiltinByteString -> BuiltinByteString
consByteString Integer
n BuiltinByteString
bs = Integer -> BuiltinByteString -> BuiltinByteString
BI.consByteString (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
n) BuiltinByteString
bs
{-# INLINABLE sliceByteString #-}
sliceByteString :: Integer -> Integer -> BuiltinByteString -> BuiltinByteString
sliceByteString :: Integer -> Integer -> BuiltinByteString -> BuiltinByteString
sliceByteString Integer
start Integer
n BuiltinByteString
bs = Integer -> Integer -> BuiltinByteString -> BuiltinByteString
BI.sliceByteString (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
start) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
n) BuiltinByteString
bs
{-# INLINABLE lengthOfByteString #-}
lengthOfByteString :: BuiltinByteString -> Integer
lengthOfByteString :: BuiltinByteString -> Integer
lengthOfByteString = BuiltinByteString -> Integer
BI.lengthOfByteString
{-# INLINABLE indexByteString #-}
indexByteString :: BuiltinByteString -> Integer -> Integer
indexByteString :: BuiltinByteString -> Integer -> Integer
indexByteString BuiltinByteString
b Integer
n = BuiltinByteString -> Integer -> Integer
BI.indexByteString BuiltinByteString
b (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
n)
{-# INLINABLE emptyByteString #-}
emptyByteString :: BuiltinByteString
emptyByteString :: BuiltinByteString
emptyByteString = BuiltinByteString
BI.emptyByteString
{-# INLINABLE sha2_256 #-}
sha2_256 :: BuiltinByteString -> BuiltinByteString
sha2_256 :: BuiltinByteString -> BuiltinByteString
sha2_256 = BuiltinByteString -> BuiltinByteString
BI.sha2_256
{-# INLINABLE sha3_256 #-}
sha3_256 :: BuiltinByteString -> BuiltinByteString
sha3_256 :: BuiltinByteString -> BuiltinByteString
sha3_256 = BuiltinByteString -> BuiltinByteString
BI.sha3_256
{-# INLINABLE blake2b_256 #-}
blake2b_256 :: BuiltinByteString -> BuiltinByteString
blake2b_256 :: BuiltinByteString -> BuiltinByteString
blake2b_256 = BuiltinByteString -> BuiltinByteString
BI.blake2b_256
{-# INLINABLE verifyEd25519Signature #-}
verifyEd25519Signature
:: BuiltinByteString
-> BuiltinByteString
-> BuiltinByteString
-> Bool
verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
verifyEd25519Signature BuiltinByteString
pubKey BuiltinByteString
message BuiltinByteString
signature = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinByteString
-> BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.verifyEd25519Signature BuiltinByteString
pubKey BuiltinByteString
message BuiltinByteString
signature)
{-# INLINABLE equalsByteString #-}
equalsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
equalsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
equalsByteString BuiltinByteString
x BuiltinByteString
y = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.equalsByteString BuiltinByteString
x BuiltinByteString
y)
{-# INLINABLE lessThanByteString #-}
lessThanByteString :: BuiltinByteString -> BuiltinByteString -> Bool
lessThanByteString :: BuiltinByteString -> BuiltinByteString -> Bool
lessThanByteString BuiltinByteString
x BuiltinByteString
y = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.lessThanByteString BuiltinByteString
x BuiltinByteString
y)
{-# INLINABLE lessThanEqualsByteString #-}
lessThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
lessThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
lessThanEqualsByteString BuiltinByteString
x BuiltinByteString
y = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.lessThanEqualsByteString BuiltinByteString
x BuiltinByteString
y)
{-# INLINABLE greaterThanByteString #-}
greaterThanByteString :: BuiltinByteString -> BuiltinByteString -> Bool
greaterThanByteString :: BuiltinByteString -> BuiltinByteString -> Bool
greaterThanByteString BuiltinByteString
x BuiltinByteString
y = BuiltinBool -> Bool -> Bool -> Bool
forall a. BuiltinBool -> a -> a -> a
BI.ifThenElse (BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.lessThanEqualsByteString BuiltinByteString
x BuiltinByteString
y) Bool
False Bool
True
{-# INLINABLE greaterThanEqualsByteString #-}
greaterThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
greaterThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
greaterThanEqualsByteString BuiltinByteString
x BuiltinByteString
y = BuiltinBool -> Bool -> Bool -> Bool
forall a. BuiltinBool -> a -> a -> a
BI.ifThenElse (BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.lessThanByteString BuiltinByteString
x BuiltinByteString
y) Bool
False Bool
True
{-# INLINABLE decodeUtf8 #-}
decodeUtf8 :: BuiltinByteString -> BuiltinString
decodeUtf8 :: BuiltinByteString -> BuiltinString
decodeUtf8 = BuiltinByteString -> BuiltinString
BI.decodeUtf8
{-# INLINEABLE verifyEcdsaSecp256k1Signature #-}
verifyEcdsaSecp256k1Signature
:: BuiltinByteString
-> BuiltinByteString
-> BuiltinByteString
-> Bool
verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
verifyEcdsaSecp256k1Signature BuiltinByteString
vk BuiltinByteString
msg BuiltinByteString
sig =
BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinByteString
-> BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.verifyEcdsaSecp256k1Signature BuiltinByteString
vk BuiltinByteString
msg BuiltinByteString
sig)
{-# INLINEABLE verifySchnorrSecp256k1Signature #-}
verifySchnorrSecp256k1Signature
:: BuiltinByteString
-> BuiltinByteString
-> BuiltinByteString
-> Bool
verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
verifySchnorrSecp256k1Signature BuiltinByteString
vk BuiltinByteString
msg BuiltinByteString
sig =
BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinByteString
-> BuiltinByteString -> BuiltinByteString -> BuiltinBool
BI.verifySchnorrSecp256k1Signature BuiltinByteString
vk BuiltinByteString
msg BuiltinByteString
sig)
{-# INLINABLE addInteger #-}
addInteger :: Integer -> Integer -> Integer
addInteger :: Integer -> Integer -> Integer
addInteger Integer
x Integer
y = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> Integer
BI.addInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE subtractInteger #-}
subtractInteger :: Integer -> Integer -> Integer
subtractInteger :: Integer -> Integer -> Integer
subtractInteger Integer
x Integer
y = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> Integer
BI.subtractInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE multiplyInteger #-}
multiplyInteger :: Integer -> Integer -> Integer
multiplyInteger :: Integer -> Integer -> Integer
multiplyInteger Integer
x Integer
y = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> Integer
BI.multiplyInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE divideInteger #-}
divideInteger :: Integer -> Integer -> Integer
divideInteger :: Integer -> Integer -> Integer
divideInteger Integer
x Integer
y = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> Integer
BI.divideInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE modInteger #-}
modInteger :: Integer -> Integer -> Integer
modInteger :: Integer -> Integer -> Integer
modInteger Integer
x Integer
y = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> Integer
BI.modInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE quotientInteger #-}
quotientInteger :: Integer -> Integer -> Integer
quotientInteger :: Integer -> Integer -> Integer
quotientInteger Integer
x Integer
y = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> Integer
BI.quotientInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE remainderInteger #-}
remainderInteger :: Integer -> Integer -> Integer
remainderInteger :: Integer -> Integer -> Integer
remainderInteger Integer
x Integer
y = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> Integer
BI.remainderInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE greaterThanInteger #-}
greaterThanInteger :: Integer -> Integer -> Bool
greaterThanInteger :: Integer -> Integer -> Bool
greaterThanInteger Integer
x Integer
y = BuiltinBool -> Bool -> Bool -> Bool
forall a. BuiltinBool -> a -> a -> a
BI.ifThenElse (Integer -> Integer -> BuiltinBool
BI.lessThanEqualsInteger Integer
x Integer
y ) Bool
False Bool
True
{-# INLINABLE greaterThanEqualsInteger #-}
greaterThanEqualsInteger :: Integer -> Integer -> Bool
greaterThanEqualsInteger :: Integer -> Integer -> Bool
greaterThanEqualsInteger Integer
x Integer
y = BuiltinBool -> Bool -> Bool -> Bool
forall a. BuiltinBool -> a -> a -> a
BI.ifThenElse (Integer -> Integer -> BuiltinBool
BI.lessThanInteger Integer
x Integer
y) Bool
False Bool
True
{-# INLINABLE lessThanInteger #-}
lessThanInteger :: Integer -> Integer -> Bool
lessThanInteger :: Integer -> Integer -> Bool
lessThanInteger Integer
x Integer
y = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> BuiltinBool
BI.lessThanInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE lessThanEqualsInteger #-}
lessThanEqualsInteger :: Integer -> Integer -> Bool
lessThanEqualsInteger :: Integer -> Integer -> Bool
lessThanEqualsInteger Integer
x Integer
y = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> BuiltinBool
BI.lessThanEqualsInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE equalsInteger #-}
equalsInteger :: Integer -> Integer -> Bool
equalsInteger :: Integer -> Integer -> Bool
equalsInteger Integer
x Integer
y = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (Integer -> Integer -> BuiltinBool
BI.equalsInteger (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
x) (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
y))
{-# INLINABLE error #-}
error :: () -> a
error :: () -> a
error ()
x = BuiltinUnit -> a
forall a. BuiltinUnit -> a
BI.error (() -> BuiltinUnit
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin ()
x)
{-# INLINABLE appendString #-}
appendString :: BuiltinString -> BuiltinString -> BuiltinString
appendString :: BuiltinString -> BuiltinString -> BuiltinString
appendString = BuiltinString -> BuiltinString -> BuiltinString
BI.appendString
{-# INLINABLE emptyString #-}
emptyString :: BuiltinString
emptyString :: BuiltinString
emptyString = BuiltinString
BI.emptyString
{-# INLINABLE equalsString #-}
equalsString :: BuiltinString -> BuiltinString -> Bool
equalsString :: BuiltinString -> BuiltinString -> Bool
equalsString BuiltinString
x BuiltinString
y = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinString -> BuiltinString -> BuiltinBool
BI.equalsString BuiltinString
x BuiltinString
y)
{-# INLINABLE trace #-}
trace :: BuiltinString -> a -> a
trace :: BuiltinString -> a -> a
trace = BuiltinString -> a -> a
forall a. BuiltinString -> a -> a
BI.trace
{-# INLINABLE encodeUtf8 #-}
encodeUtf8 :: BuiltinString -> BuiltinByteString
encodeUtf8 :: BuiltinString -> BuiltinByteString
encodeUtf8 = BuiltinString -> BuiltinByteString
BI.encodeUtf8
matchList :: forall a r . BI.BuiltinList a -> r -> (a -> BI.BuiltinList a -> r) -> r
matchList :: BuiltinList a -> r -> (a -> BuiltinList a -> r) -> r
matchList BuiltinList a
l r
nilCase a -> BuiltinList a -> r
consCase = BuiltinList a -> (() -> r) -> (() -> r) -> () -> r
forall a b. BuiltinList a -> b -> b -> b
BI.chooseList BuiltinList a
l (r -> () -> r
forall a b. a -> b -> a
const r
nilCase) (\()
_ -> a -> BuiltinList a -> r
consCase (BuiltinList a -> a
forall a. BuiltinList a -> a
BI.head BuiltinList a
l) (BuiltinList a -> BuiltinList a
forall a. BuiltinList a -> BuiltinList a
BI.tail BuiltinList a
l)) ()
{-# INLINABLE chooseData #-}
chooseData :: forall a . BuiltinData -> a -> a -> a -> a -> a -> a
chooseData :: BuiltinData -> a -> a -> a -> a -> a -> a
chooseData = BuiltinData -> a -> a -> a -> a -> a -> a
forall a. BuiltinData -> a -> a -> a -> a -> a -> a
BI.chooseData
{-# INLINABLE serialiseData #-}
serialiseData :: BuiltinData -> BuiltinByteString
serialiseData :: BuiltinData -> BuiltinByteString
serialiseData = BuiltinData -> BuiltinByteString
BI.serialiseData
{-# INLINABLE mkConstr #-}
mkConstr :: Integer -> [BuiltinData] -> BuiltinData
mkConstr :: Integer -> [BuiltinData] -> BuiltinData
mkConstr Integer
i [BuiltinData]
args = Integer -> BuiltinList BuiltinData -> BuiltinData
BI.mkConstr (Integer -> Integer
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin Integer
i) ([BuiltinData] -> BuiltinList BuiltinData
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin [BuiltinData]
args)
{-# INLINABLE mkMap #-}
mkMap :: [(BuiltinData, BuiltinData)] -> BuiltinData
mkMap :: [(BuiltinData, BuiltinData)] -> BuiltinData
mkMap [(BuiltinData, BuiltinData)]
es = BuiltinList (BuiltinPair BuiltinData BuiltinData) -> BuiltinData
BI.mkMap ([(BuiltinData, BuiltinData)]
-> BuiltinList (BuiltinPair BuiltinData BuiltinData)
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin [(BuiltinData, BuiltinData)]
es)
{-# INLINABLE mkList #-}
mkList :: [BuiltinData] -> BuiltinData
mkList :: [BuiltinData] -> BuiltinData
mkList [BuiltinData]
l = BuiltinList BuiltinData -> BuiltinData
BI.mkList ([BuiltinData] -> BuiltinList BuiltinData
forall a arep. ToBuiltin a arep => a -> arep
toBuiltin [BuiltinData]
l)
{-# INLINABLE mkI #-}
mkI :: Integer -> BuiltinData
mkI :: Integer -> BuiltinData
mkI = Integer -> BuiltinData
BI.mkI
{-# INLINABLE mkB #-}
mkB :: BuiltinByteString -> BuiltinData
mkB :: BuiltinByteString -> BuiltinData
mkB = BuiltinByteString -> BuiltinData
BI.mkB
{-# INLINABLE unsafeDataAsConstr #-}
unsafeDataAsConstr :: BuiltinData -> (Integer, [BuiltinData])
unsafeDataAsConstr :: BuiltinData -> (Integer, [BuiltinData])
unsafeDataAsConstr BuiltinData
d = BuiltinPair Integer (BuiltinList BuiltinData)
-> (Integer, [BuiltinData])
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinData -> BuiltinPair Integer (BuiltinList BuiltinData)
BI.unsafeDataAsConstr BuiltinData
d)
{-# INLINABLE unsafeDataAsMap #-}
unsafeDataAsMap :: BuiltinData -> [(BuiltinData, BuiltinData)]
unsafeDataAsMap :: BuiltinData -> [(BuiltinData, BuiltinData)]
unsafeDataAsMap BuiltinData
d = BuiltinList (BuiltinPair BuiltinData BuiltinData)
-> [(BuiltinData, BuiltinData)]
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinData -> BuiltinList (BuiltinPair BuiltinData BuiltinData)
BI.unsafeDataAsMap BuiltinData
d)
{-# INLINABLE unsafeDataAsList #-}
unsafeDataAsList :: BuiltinData -> [BuiltinData]
unsafeDataAsList :: BuiltinData -> [BuiltinData]
unsafeDataAsList BuiltinData
d = BuiltinList BuiltinData -> [BuiltinData]
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinData -> BuiltinList BuiltinData
BI.unsafeDataAsList BuiltinData
d)
{-# INLINABLE unsafeDataAsI #-}
unsafeDataAsI :: BuiltinData -> Integer
unsafeDataAsI :: BuiltinData -> Integer
unsafeDataAsI BuiltinData
d = Integer -> Integer
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinData -> Integer
BI.unsafeDataAsI BuiltinData
d)
{-# INLINABLE unsafeDataAsB #-}
unsafeDataAsB :: BuiltinData -> BuiltinByteString
unsafeDataAsB :: BuiltinData -> BuiltinByteString
unsafeDataAsB = BuiltinData -> BuiltinByteString
BI.unsafeDataAsB
{-# INLINABLE equalsData #-}
equalsData :: BuiltinData -> BuiltinData -> Bool
equalsData :: BuiltinData -> BuiltinData -> Bool
equalsData BuiltinData
d1 BuiltinData
d2 = BuiltinBool -> Bool
forall arep a. FromBuiltin arep a => arep -> a
fromBuiltin (BuiltinData -> BuiltinData -> BuiltinBool
BI.equalsData BuiltinData
d1 BuiltinData
d2)
{-# INLINABLE matchData #-}
matchData
:: BuiltinData
-> (Integer -> [BuiltinData] -> r)
-> ([(BuiltinData, BuiltinData)] -> r)
-> ([BuiltinData] -> r)
-> (Integer -> r)
-> (BuiltinByteString -> r)
-> r
matchData :: BuiltinData
-> (Integer -> [BuiltinData] -> r)
-> ([(BuiltinData, BuiltinData)] -> r)
-> ([BuiltinData] -> r)
-> (Integer -> r)
-> (BuiltinByteString -> r)
-> r
matchData BuiltinData
d Integer -> [BuiltinData] -> r
constrCase [(BuiltinData, BuiltinData)] -> r
mapCase [BuiltinData] -> r
listCase Integer -> r
iCase BuiltinByteString -> r
bCase =
BuiltinData
-> (() -> r)
-> (() -> r)
-> (() -> r)
-> (() -> r)
-> (() -> r)
-> ()
-> r
forall a. BuiltinData -> a -> a -> a -> a -> a -> a
chooseData
BuiltinData
d
(\()
_ -> (Integer -> [BuiltinData] -> r) -> (Integer, [BuiltinData]) -> r
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Integer -> [BuiltinData] -> r
constrCase (BuiltinData -> (Integer, [BuiltinData])
unsafeDataAsConstr BuiltinData
d))
(\()
_ -> [(BuiltinData, BuiltinData)] -> r
mapCase (BuiltinData -> [(BuiltinData, BuiltinData)]
unsafeDataAsMap BuiltinData
d))
(\()
_ -> [BuiltinData] -> r
listCase (BuiltinData -> [BuiltinData]
unsafeDataAsList BuiltinData
d))
(\()
_ -> Integer -> r
iCase (BuiltinData -> Integer
unsafeDataAsI BuiltinData
d))
(\()
_ -> BuiltinByteString -> r
bCase (BuiltinData -> BuiltinByteString
unsafeDataAsB BuiltinData
d))
()
{-# INLINABLE matchData' #-}
matchData'
:: BuiltinData
-> (Integer -> BI.BuiltinList BuiltinData -> r)
-> (BI.BuiltinList (BI.BuiltinPair BuiltinData BuiltinData) -> r)
-> (BI.BuiltinList BuiltinData -> r)
-> (Integer -> r)
-> (BuiltinByteString -> r)
-> r
matchData' :: BuiltinData
-> (Integer -> BuiltinList BuiltinData -> r)
-> (BuiltinList (BuiltinPair BuiltinData BuiltinData) -> r)
-> (BuiltinList BuiltinData -> r)
-> (Integer -> r)
-> (BuiltinByteString -> r)
-> r
matchData' BuiltinData
d Integer -> BuiltinList BuiltinData -> r
constrCase BuiltinList (BuiltinPair BuiltinData BuiltinData) -> r
mapCase BuiltinList BuiltinData -> r
listCase Integer -> r
iCase BuiltinByteString -> r
bCase =
BuiltinData
-> (() -> r)
-> (() -> r)
-> (() -> r)
-> (() -> r)
-> (() -> r)
-> ()
-> r
forall a. BuiltinData -> a -> a -> a -> a -> a -> a
chooseData
BuiltinData
d
(\()
_ -> let tup :: BuiltinPair Integer (BuiltinList BuiltinData)
tup = BuiltinData -> BuiltinPair Integer (BuiltinList BuiltinData)
BI.unsafeDataAsConstr BuiltinData
d in Integer -> BuiltinList BuiltinData -> r
constrCase (BuiltinPair Integer (BuiltinList BuiltinData) -> Integer
forall a b. BuiltinPair a b -> a
BI.fst BuiltinPair Integer (BuiltinList BuiltinData)
tup) (BuiltinPair Integer (BuiltinList BuiltinData)
-> BuiltinList BuiltinData
forall a b. BuiltinPair a b -> b
BI.snd BuiltinPair Integer (BuiltinList BuiltinData)
tup))
(\()
_ -> BuiltinList (BuiltinPair BuiltinData BuiltinData) -> r
mapCase (BuiltinData -> BuiltinList (BuiltinPair BuiltinData BuiltinData)
BI.unsafeDataAsMap BuiltinData
d))
(\()
_ -> BuiltinList BuiltinData -> r
listCase (BuiltinData -> BuiltinList BuiltinData
BI.unsafeDataAsList BuiltinData
d))
(\()
_ -> Integer -> r
iCase (BuiltinData -> Integer
unsafeDataAsI BuiltinData
d))
(\()
_ -> BuiltinByteString -> r
bCase (BuiltinData -> BuiltinByteString
unsafeDataAsB BuiltinData
d))
()