module Covenant.Prim
( OneArgFunc (..),
typeOneArgFunc,
TwoArgFunc (..),
typeTwoArgFunc,
ThreeArgFunc (..),
typeThreeArgFunc,
SixArgFunc (..),
typeSixArgFunc,
)
where
import Covenant.DeBruijn (DeBruijn (S, Z))
import Covenant.Index (ix0, ix1)
import Covenant.Type
( AbstractTy,
CompT (Comp0, Comp1, Comp2),
CompTBody (ReturnT, (:--:>)),
ValT (ThunkT),
boolT,
byteStringT,
dataType1T,
dataType2T,
dataTypeT,
g1T,
g2T,
integerT,
mlResultT,
stringT,
tyvar,
unitT,
)
import Test.QuickCheck (Arbitrary (arbitrary), elements)
data OneArgFunc
= LengthOfByteString
| Sha2_256
| Sha3_256
| Blake2b_256
| EncodeUtf8
| DecodeUtf8
|
FstPair
|
SndPair
|
HeadList
|
TailList
|
NullList
|
MapData
|
ListData
|
IData
|
BData
|
UnConstrData
|
UnMapData
|
UnListData
|
UnIData
|
UnBData
|
SerialiseData
| BLS12_381_G1_neg
| BLS12_381_G1_compress
| BLS12_381_G1_uncompress
| BLS12_381_G2_neg
| BLS12_381_G2_compress
| BLS12_381_G2_uncompress
| Keccak_256
| Blake2b_224
| ComplementByteString
| CountSetBits
| FindFirstSetBit
| Ripemd_160
deriving stock
(
OneArgFunc -> OneArgFunc -> Bool
(OneArgFunc -> OneArgFunc -> Bool)
-> (OneArgFunc -> OneArgFunc -> Bool) -> Eq OneArgFunc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OneArgFunc -> OneArgFunc -> Bool
== :: OneArgFunc -> OneArgFunc -> Bool
$c/= :: OneArgFunc -> OneArgFunc -> Bool
/= :: OneArgFunc -> OneArgFunc -> Bool
Eq,
Eq OneArgFunc
Eq OneArgFunc =>
(OneArgFunc -> OneArgFunc -> Ordering)
-> (OneArgFunc -> OneArgFunc -> Bool)
-> (OneArgFunc -> OneArgFunc -> Bool)
-> (OneArgFunc -> OneArgFunc -> Bool)
-> (OneArgFunc -> OneArgFunc -> Bool)
-> (OneArgFunc -> OneArgFunc -> OneArgFunc)
-> (OneArgFunc -> OneArgFunc -> OneArgFunc)
-> Ord OneArgFunc
OneArgFunc -> OneArgFunc -> Bool
OneArgFunc -> OneArgFunc -> Ordering
OneArgFunc -> OneArgFunc -> OneArgFunc
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: OneArgFunc -> OneArgFunc -> Ordering
compare :: OneArgFunc -> OneArgFunc -> Ordering
$c< :: OneArgFunc -> OneArgFunc -> Bool
< :: OneArgFunc -> OneArgFunc -> Bool
$c<= :: OneArgFunc -> OneArgFunc -> Bool
<= :: OneArgFunc -> OneArgFunc -> Bool
$c> :: OneArgFunc -> OneArgFunc -> Bool
> :: OneArgFunc -> OneArgFunc -> Bool
$c>= :: OneArgFunc -> OneArgFunc -> Bool
>= :: OneArgFunc -> OneArgFunc -> Bool
$cmax :: OneArgFunc -> OneArgFunc -> OneArgFunc
max :: OneArgFunc -> OneArgFunc -> OneArgFunc
$cmin :: OneArgFunc -> OneArgFunc -> OneArgFunc
min :: OneArgFunc -> OneArgFunc -> OneArgFunc
Ord,
Int -> OneArgFunc -> ShowS
[OneArgFunc] -> ShowS
OneArgFunc -> String
(Int -> OneArgFunc -> ShowS)
-> (OneArgFunc -> String)
-> ([OneArgFunc] -> ShowS)
-> Show OneArgFunc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OneArgFunc -> ShowS
showsPrec :: Int -> OneArgFunc -> ShowS
$cshow :: OneArgFunc -> String
show :: OneArgFunc -> String
$cshowList :: [OneArgFunc] -> ShowS
showList :: [OneArgFunc] -> ShowS
Show
)
instance Arbitrary OneArgFunc where
{-# INLINEABLE arbitrary #-}
arbitrary :: Gen OneArgFunc
arbitrary =
[OneArgFunc] -> Gen OneArgFunc
forall a. HasCallStack => [a] -> Gen a
elements
[ OneArgFunc
LengthOfByteString,
OneArgFunc
Sha2_256,
OneArgFunc
Sha3_256,
OneArgFunc
Blake2b_256,
OneArgFunc
EncodeUtf8,
OneArgFunc
DecodeUtf8,
OneArgFunc
FstPair,
OneArgFunc
SndPair,
OneArgFunc
HeadList,
OneArgFunc
TailList,
OneArgFunc
NullList,
OneArgFunc
MapData,
OneArgFunc
ListData,
OneArgFunc
IData,
OneArgFunc
BData,
OneArgFunc
UnConstrData,
OneArgFunc
UnMapData,
OneArgFunc
UnListData,
OneArgFunc
UnIData,
OneArgFunc
UnBData,
OneArgFunc
SerialiseData,
OneArgFunc
BLS12_381_G1_neg,
OneArgFunc
BLS12_381_G1_compress,
OneArgFunc
BLS12_381_G1_uncompress,
OneArgFunc
BLS12_381_G2_neg,
OneArgFunc
BLS12_381_G2_compress,
OneArgFunc
BLS12_381_G2_uncompress,
OneArgFunc
Keccak_256,
OneArgFunc
Blake2b_224,
OneArgFunc
ComplementByteString,
OneArgFunc
CountSetBits,
OneArgFunc
FindFirstSetBit,
OneArgFunc
Ripemd_160
]
typeOneArgFunc :: OneArgFunc -> CompT AbstractTy
typeOneArgFunc :: OneArgFunc -> CompT AbstractTy
typeOneArgFunc = \case
OneArgFunc
LengthOfByteString -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
integerT
OneArgFunc
Sha2_256 -> CompT AbstractTy
hashingT
OneArgFunc
Sha3_256 -> CompT AbstractTy
hashingT
OneArgFunc
Blake2b_256 -> CompT AbstractTy
hashingT
OneArgFunc
EncodeUtf8 -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
stringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
OneArgFunc
DecodeUtf8 -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
stringT
OneArgFunc
FstPair -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp2 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT ValT AbstractTy
aT ValT AbstractTy
bT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aT
OneArgFunc
SndPair -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp2 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT ValT AbstractTy
aT ValT AbstractTy
bT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
bT
OneArgFunc
HeadList -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aT
OneArgFunc
TailList -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT (ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT)
OneArgFunc
NullList -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
boolT
OneArgFunc
MapData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT (ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT ValT AbstractTy
dataT ValT AbstractTy
dataT) ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
dataT
OneArgFunc
ListData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
dataT
OneArgFunc
IData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
dataT
OneArgFunc
BData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
dataT
OneArgFunc
UnConstrData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT (ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT ValT AbstractTy
forall a. ValT a
integerT (ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
dataT))
OneArgFunc
UnMapData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT (ValT AbstractTy -> ValT AbstractTy
listT (ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT ValT AbstractTy
dataT ValT AbstractTy
dataT))
OneArgFunc
UnListData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT (ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
dataT)
OneArgFunc
UnIData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
integerT
OneArgFunc
UnBData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
OneArgFunc
SerialiseData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
OneArgFunc
BLS12_381_G1_neg -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
g1T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g1T
OneArgFunc
BLS12_381_G1_compress -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
g1T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
OneArgFunc
BLS12_381_G1_uncompress -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g1T
OneArgFunc
BLS12_381_G2_neg -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
g2T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g2T
OneArgFunc
BLS12_381_G2_compress -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
g2T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
OneArgFunc
BLS12_381_G2_uncompress -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g2T
OneArgFunc
Keccak_256 -> CompT AbstractTy
hashingT
OneArgFunc
Blake2b_224 -> CompT AbstractTy
hashingT
OneArgFunc
ComplementByteString -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
OneArgFunc
CountSetBits -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
integerT
OneArgFunc
FindFirstSetBit -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
integerT
OneArgFunc
Ripemd_160 -> CompT AbstractTy
hashingT
where
hashingT :: CompT AbstractTy
hashingT :: CompT AbstractTy
hashingT = CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
data TwoArgFunc
= AddInteger
| SubtractInteger
| MultiplyInteger
| DivideInteger
| QuotientInteger
| RemainderInteger
| ModInteger
| EqualsInteger
| LessThanInteger
| LessThanEqualsInteger
| AppendByteString
| ConsByteString
| IndexByteString
| EqualsByteString
| LessThanByteString
| LessThanEqualsByteString
| AppendString
| EqualsString
| ChooseUnit
| Trace
|
MkCons
|
ConstrData
|
EqualsData
|
MkPairData
| 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
deriving stock
(
TwoArgFunc -> TwoArgFunc -> Bool
(TwoArgFunc -> TwoArgFunc -> Bool)
-> (TwoArgFunc -> TwoArgFunc -> Bool) -> Eq TwoArgFunc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TwoArgFunc -> TwoArgFunc -> Bool
== :: TwoArgFunc -> TwoArgFunc -> Bool
$c/= :: TwoArgFunc -> TwoArgFunc -> Bool
/= :: TwoArgFunc -> TwoArgFunc -> Bool
Eq,
Eq TwoArgFunc
Eq TwoArgFunc =>
(TwoArgFunc -> TwoArgFunc -> Ordering)
-> (TwoArgFunc -> TwoArgFunc -> Bool)
-> (TwoArgFunc -> TwoArgFunc -> Bool)
-> (TwoArgFunc -> TwoArgFunc -> Bool)
-> (TwoArgFunc -> TwoArgFunc -> Bool)
-> (TwoArgFunc -> TwoArgFunc -> TwoArgFunc)
-> (TwoArgFunc -> TwoArgFunc -> TwoArgFunc)
-> Ord TwoArgFunc
TwoArgFunc -> TwoArgFunc -> Bool
TwoArgFunc -> TwoArgFunc -> Ordering
TwoArgFunc -> TwoArgFunc -> TwoArgFunc
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TwoArgFunc -> TwoArgFunc -> Ordering
compare :: TwoArgFunc -> TwoArgFunc -> Ordering
$c< :: TwoArgFunc -> TwoArgFunc -> Bool
< :: TwoArgFunc -> TwoArgFunc -> Bool
$c<= :: TwoArgFunc -> TwoArgFunc -> Bool
<= :: TwoArgFunc -> TwoArgFunc -> Bool
$c> :: TwoArgFunc -> TwoArgFunc -> Bool
> :: TwoArgFunc -> TwoArgFunc -> Bool
$c>= :: TwoArgFunc -> TwoArgFunc -> Bool
>= :: TwoArgFunc -> TwoArgFunc -> Bool
$cmax :: TwoArgFunc -> TwoArgFunc -> TwoArgFunc
max :: TwoArgFunc -> TwoArgFunc -> TwoArgFunc
$cmin :: TwoArgFunc -> TwoArgFunc -> TwoArgFunc
min :: TwoArgFunc -> TwoArgFunc -> TwoArgFunc
Ord,
Int -> TwoArgFunc -> ShowS
[TwoArgFunc] -> ShowS
TwoArgFunc -> String
(Int -> TwoArgFunc -> ShowS)
-> (TwoArgFunc -> String)
-> ([TwoArgFunc] -> ShowS)
-> Show TwoArgFunc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TwoArgFunc -> ShowS
showsPrec :: Int -> TwoArgFunc -> ShowS
$cshow :: TwoArgFunc -> String
show :: TwoArgFunc -> String
$cshowList :: [TwoArgFunc] -> ShowS
showList :: [TwoArgFunc] -> ShowS
Show
)
instance Arbitrary TwoArgFunc where
{-# INLINEABLE arbitrary #-}
arbitrary :: Gen TwoArgFunc
arbitrary =
[TwoArgFunc] -> Gen TwoArgFunc
forall a. HasCallStack => [a] -> Gen a
elements
[ TwoArgFunc
AddInteger,
TwoArgFunc
SubtractInteger,
TwoArgFunc
MultiplyInteger,
TwoArgFunc
DivideInteger,
TwoArgFunc
QuotientInteger,
TwoArgFunc
RemainderInteger,
TwoArgFunc
ModInteger,
TwoArgFunc
EqualsInteger,
TwoArgFunc
LessThanInteger,
TwoArgFunc
LessThanEqualsInteger,
TwoArgFunc
AppendByteString,
TwoArgFunc
ConsByteString,
TwoArgFunc
IndexByteString,
TwoArgFunc
EqualsByteString,
TwoArgFunc
LessThanByteString,
TwoArgFunc
LessThanEqualsByteString,
TwoArgFunc
AppendString,
TwoArgFunc
EqualsString,
TwoArgFunc
ChooseUnit,
TwoArgFunc
Trace,
TwoArgFunc
MkCons,
TwoArgFunc
ConstrData,
TwoArgFunc
EqualsData,
TwoArgFunc
MkPairData,
TwoArgFunc
BLS12_381_G1_add,
TwoArgFunc
BLS12_381_G1_scalarMul,
TwoArgFunc
BLS12_381_G1_equal,
TwoArgFunc
BLS12_381_G1_hashToGroup,
TwoArgFunc
BLS12_381_G2_add,
TwoArgFunc
BLS12_381_G2_scalarMul,
TwoArgFunc
BLS12_381_G2_equal,
TwoArgFunc
BLS12_381_G2_hashToGroup,
TwoArgFunc
BLS12_381_millerLoop,
TwoArgFunc
BLS12_381_mulMlResult,
TwoArgFunc
BLS12_381_finalVerify,
TwoArgFunc
ByteStringToInteger,
TwoArgFunc
ReadBit,
TwoArgFunc
ReplicateByte,
TwoArgFunc
ShiftByteString,
TwoArgFunc
RotateByteString
]
typeTwoArgFunc :: TwoArgFunc -> CompT AbstractTy
typeTwoArgFunc :: TwoArgFunc -> CompT AbstractTy
typeTwoArgFunc = \case
TwoArgFunc
AddInteger -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
SubtractInteger -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
MultiplyInteger -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
DivideInteger -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
QuotientInteger -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
RemainderInteger -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
ModInteger -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
EqualsInteger -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
LessThanInteger -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
LessThanEqualsInteger -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
AppendByteString -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
byteStringT
TwoArgFunc
ConsByteString -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
TwoArgFunc
IndexByteString -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
EqualsByteString -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
byteStringT
TwoArgFunc
LessThanByteString -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
byteStringT
TwoArgFunc
LessThanEqualsByteString -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
byteStringT
TwoArgFunc
AppendString -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
stringT
TwoArgFunc
EqualsString -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
stringT
TwoArgFunc
ChooseUnit -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
unitT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aT
TwoArgFunc
Trace -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
stringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aT
TwoArgFunc
MkCons -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT (ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT)
TwoArgFunc
ConstrData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
dataT
TwoArgFunc
EqualsData -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
dataT
TwoArgFunc
MkPairData -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT (ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT ValT AbstractTy
dataT ValT AbstractTy
dataT)
TwoArgFunc
BLS12_381_G1_add -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
g1T
TwoArgFunc
BLS12_381_G1_scalarMul -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
g1T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g1T
TwoArgFunc
BLS12_381_G1_equal -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
g1T
TwoArgFunc
BLS12_381_G1_hashToGroup -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g1T
TwoArgFunc
BLS12_381_G2_add -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
g2T
TwoArgFunc
BLS12_381_G2_scalarMul -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
g2T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g2T
TwoArgFunc
BLS12_381_G2_equal -> ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
forall a. ValT a
g2T
TwoArgFunc
BLS12_381_G2_hashToGroup -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
g2T
TwoArgFunc
BLS12_381_millerLoop -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
g1T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
g2T ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
mlResultT
TwoArgFunc
BLS12_381_mulMlResult -> ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
forall a. ValT a
mlResultT
TwoArgFunc
BLS12_381_finalVerify -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
mlResultT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
mlResultT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
boolT
TwoArgFunc
ByteStringToInteger -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
boolT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
integerT
TwoArgFunc
ReadBit -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
boolT
TwoArgFunc
ReplicateByte -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
TwoArgFunc
ShiftByteString -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
TwoArgFunc
RotateByteString -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
where
combineT :: ValT AbstractTy -> CompT AbstractTy
combineT :: ValT AbstractTy -> CompT AbstractTy
combineT ValT AbstractTy
t = CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
t ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
t ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
t
compareT :: ValT AbstractTy -> CompT AbstractTy
compareT :: ValT AbstractTy -> CompT AbstractTy
compareT ValT AbstractTy
t = CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
t ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
t ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
boolT
data ThreeArgFunc
= VerifyEd25519Signature
| VerifyEcdsaSecp256k1Signature
| VerifySchnorrSecp256k1Signature
| IfThenElse
|
ChooseList
|
CaseList
| IntegerToByteString
| AndByteString
| OrByteString
| XorByteString
| WriteBits
| ExpModInteger
deriving stock
(
ThreeArgFunc -> ThreeArgFunc -> Bool
(ThreeArgFunc -> ThreeArgFunc -> Bool)
-> (ThreeArgFunc -> ThreeArgFunc -> Bool) -> Eq ThreeArgFunc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThreeArgFunc -> ThreeArgFunc -> Bool
== :: ThreeArgFunc -> ThreeArgFunc -> Bool
$c/= :: ThreeArgFunc -> ThreeArgFunc -> Bool
/= :: ThreeArgFunc -> ThreeArgFunc -> Bool
Eq,
Eq ThreeArgFunc
Eq ThreeArgFunc =>
(ThreeArgFunc -> ThreeArgFunc -> Ordering)
-> (ThreeArgFunc -> ThreeArgFunc -> Bool)
-> (ThreeArgFunc -> ThreeArgFunc -> Bool)
-> (ThreeArgFunc -> ThreeArgFunc -> Bool)
-> (ThreeArgFunc -> ThreeArgFunc -> Bool)
-> (ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc)
-> (ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc)
-> Ord ThreeArgFunc
ThreeArgFunc -> ThreeArgFunc -> Bool
ThreeArgFunc -> ThreeArgFunc -> Ordering
ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ThreeArgFunc -> ThreeArgFunc -> Ordering
compare :: ThreeArgFunc -> ThreeArgFunc -> Ordering
$c< :: ThreeArgFunc -> ThreeArgFunc -> Bool
< :: ThreeArgFunc -> ThreeArgFunc -> Bool
$c<= :: ThreeArgFunc -> ThreeArgFunc -> Bool
<= :: ThreeArgFunc -> ThreeArgFunc -> Bool
$c> :: ThreeArgFunc -> ThreeArgFunc -> Bool
> :: ThreeArgFunc -> ThreeArgFunc -> Bool
$c>= :: ThreeArgFunc -> ThreeArgFunc -> Bool
>= :: ThreeArgFunc -> ThreeArgFunc -> Bool
$cmax :: ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc
max :: ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc
$cmin :: ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc
min :: ThreeArgFunc -> ThreeArgFunc -> ThreeArgFunc
Ord,
Int -> ThreeArgFunc -> ShowS
[ThreeArgFunc] -> ShowS
ThreeArgFunc -> String
(Int -> ThreeArgFunc -> ShowS)
-> (ThreeArgFunc -> String)
-> ([ThreeArgFunc] -> ShowS)
-> Show ThreeArgFunc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThreeArgFunc -> ShowS
showsPrec :: Int -> ThreeArgFunc -> ShowS
$cshow :: ThreeArgFunc -> String
show :: ThreeArgFunc -> String
$cshowList :: [ThreeArgFunc] -> ShowS
showList :: [ThreeArgFunc] -> ShowS
Show
)
instance Arbitrary ThreeArgFunc where
{-# INLINEABLE arbitrary #-}
arbitrary :: Gen ThreeArgFunc
arbitrary =
[ThreeArgFunc] -> Gen ThreeArgFunc
forall a. HasCallStack => [a] -> Gen a
elements
[ ThreeArgFunc
VerifyEd25519Signature,
ThreeArgFunc
VerifyEcdsaSecp256k1Signature,
ThreeArgFunc
VerifySchnorrSecp256k1Signature,
ThreeArgFunc
IfThenElse,
ThreeArgFunc
ChooseList,
ThreeArgFunc
CaseList,
ThreeArgFunc
IntegerToByteString,
ThreeArgFunc
AndByteString,
ThreeArgFunc
OrByteString,
ThreeArgFunc
XorByteString,
ThreeArgFunc
WriteBits,
ThreeArgFunc
ExpModInteger
]
typeThreeArgFunc :: ThreeArgFunc -> CompT AbstractTy
typeThreeArgFunc :: ThreeArgFunc -> CompT AbstractTy
typeThreeArgFunc = \case
ThreeArgFunc
VerifyEd25519Signature -> CompT AbstractTy
signatureT
ThreeArgFunc
VerifyEcdsaSecp256k1Signature -> CompT AbstractTy
signatureT
ThreeArgFunc
VerifySchnorrSecp256k1Signature -> CompT AbstractTy
signatureT
ThreeArgFunc
IfThenElse -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
boolT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aT
ThreeArgFunc
ChooseList -> CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp2 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
bT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
bT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
bT
ThreeArgFunc
CaseList ->
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp2 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
ValT AbstractTy
bT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> CompT AbstractTy -> ValT AbstractTy
forall a. CompT a -> ValT a
ThunkT (CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
aTOuter ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aTOuter ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
bTOuter)
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
aT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
bT
ThreeArgFunc
IntegerToByteString ->
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
ValT AbstractTy
forall a. ValT a
boolT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
ThreeArgFunc
AndByteString -> CompT AbstractTy
bitwiseT
ThreeArgFunc
OrByteString -> CompT AbstractTy
bitwiseT
ThreeArgFunc
XorByteString -> CompT AbstractTy
bitwiseT
ThreeArgFunc
WriteBits ->
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
boolT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
ThreeArgFunc
ExpModInteger ->
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
ValT AbstractTy
forall a. ValT a
integerT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
integerT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
integerT
where
signatureT :: CompT AbstractTy
signatureT :: CompT AbstractTy
signatureT =
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
ValT AbstractTy
forall a. ValT a
byteStringT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
boolT
bitwiseT :: CompT AbstractTy
bitwiseT :: CompT AbstractTy
bitwiseT =
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
ValT AbstractTy
forall a. ValT a
boolT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
forall a. ValT a
byteStringT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
forall a. ValT a
byteStringT
data SixArgFunc
= ChooseData
| CaseData
deriving stock
(
SixArgFunc -> SixArgFunc -> Bool
(SixArgFunc -> SixArgFunc -> Bool)
-> (SixArgFunc -> SixArgFunc -> Bool) -> Eq SixArgFunc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SixArgFunc -> SixArgFunc -> Bool
== :: SixArgFunc -> SixArgFunc -> Bool
$c/= :: SixArgFunc -> SixArgFunc -> Bool
/= :: SixArgFunc -> SixArgFunc -> Bool
Eq,
Eq SixArgFunc
Eq SixArgFunc =>
(SixArgFunc -> SixArgFunc -> Ordering)
-> (SixArgFunc -> SixArgFunc -> Bool)
-> (SixArgFunc -> SixArgFunc -> Bool)
-> (SixArgFunc -> SixArgFunc -> Bool)
-> (SixArgFunc -> SixArgFunc -> Bool)
-> (SixArgFunc -> SixArgFunc -> SixArgFunc)
-> (SixArgFunc -> SixArgFunc -> SixArgFunc)
-> Ord SixArgFunc
SixArgFunc -> SixArgFunc -> Bool
SixArgFunc -> SixArgFunc -> Ordering
SixArgFunc -> SixArgFunc -> SixArgFunc
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SixArgFunc -> SixArgFunc -> Ordering
compare :: SixArgFunc -> SixArgFunc -> Ordering
$c< :: SixArgFunc -> SixArgFunc -> Bool
< :: SixArgFunc -> SixArgFunc -> Bool
$c<= :: SixArgFunc -> SixArgFunc -> Bool
<= :: SixArgFunc -> SixArgFunc -> Bool
$c> :: SixArgFunc -> SixArgFunc -> Bool
> :: SixArgFunc -> SixArgFunc -> Bool
$c>= :: SixArgFunc -> SixArgFunc -> Bool
>= :: SixArgFunc -> SixArgFunc -> Bool
$cmax :: SixArgFunc -> SixArgFunc -> SixArgFunc
max :: SixArgFunc -> SixArgFunc -> SixArgFunc
$cmin :: SixArgFunc -> SixArgFunc -> SixArgFunc
min :: SixArgFunc -> SixArgFunc -> SixArgFunc
Ord,
Int -> SixArgFunc -> ShowS
[SixArgFunc] -> ShowS
SixArgFunc -> String
(Int -> SixArgFunc -> ShowS)
-> (SixArgFunc -> String)
-> ([SixArgFunc] -> ShowS)
-> Show SixArgFunc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SixArgFunc -> ShowS
showsPrec :: Int -> SixArgFunc -> ShowS
$cshow :: SixArgFunc -> String
show :: SixArgFunc -> String
$cshowList :: [SixArgFunc] -> ShowS
showList :: [SixArgFunc] -> ShowS
Show
)
instance Arbitrary SixArgFunc where
{-# INLINEABLE arbitrary #-}
arbitrary :: Gen SixArgFunc
arbitrary = [SixArgFunc] -> Gen SixArgFunc
forall a. HasCallStack => [a] -> Gen a
elements [SixArgFunc
ChooseData, SixArgFunc
CaseData]
typeSixArgFunc :: SixArgFunc -> CompT AbstractTy
typeSixArgFunc :: SixArgFunc -> CompT AbstractTy
typeSixArgFunc = \case
SixArgFunc
ChooseData ->
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
ValT AbstractTy
dataT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
aT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aT
SixArgFunc
CaseData ->
CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp1 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$
CompT AbstractTy -> ValT AbstractTy
forall a. CompT a -> ValT a
ThunkT (CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aTOuter)
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> CompT AbstractTy -> ValT AbstractTy
forall a. CompT a -> ValT a
ThunkT (CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT (ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT ValT AbstractTy
dataT ValT AbstractTy
dataT) ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aTOuter)
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> CompT AbstractTy -> ValT AbstractTy
forall a. CompT a -> ValT a
ThunkT (CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy -> ValT AbstractTy
listT ValT AbstractTy
dataT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aTOuter)
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> CompT AbstractTy -> ValT AbstractTy
forall a. CompT a -> ValT a
ThunkT (CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
integerT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aTOuter)
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> CompT AbstractTy -> ValT AbstractTy
forall a. CompT a -> ValT a
ThunkT (CompTBody AbstractTy -> CompT AbstractTy
forall a. CompTBody a -> CompT a
Comp0 (CompTBody AbstractTy -> CompT AbstractTy)
-> CompTBody AbstractTy -> CompT AbstractTy
forall a b. (a -> b) -> a -> b
$ ValT AbstractTy
forall a. ValT a
byteStringT ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aTOuter)
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy
dataT
ValT AbstractTy -> CompTBody AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a -> CompTBody a
:--:> ValT AbstractTy -> CompTBody AbstractTy
forall a. ValT a -> CompTBody a
ReturnT ValT AbstractTy
aT
dataT :: ValT AbstractTy
dataT :: ValT AbstractTy
dataT = TyName -> ValT AbstractTy
forall a. TyName -> ValT a
dataTypeT TyName
"Data"
listT :: ValT AbstractTy -> ValT AbstractTy
listT :: ValT AbstractTy -> ValT AbstractTy
listT = TyName -> ValT AbstractTy -> ValT AbstractTy
dataType1T TyName
"List"
pairT :: ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT :: ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
pairT = TyName -> ValT AbstractTy -> ValT AbstractTy -> ValT AbstractTy
dataType2T TyName
"Pair"
aT :: ValT AbstractTy
aT :: ValT AbstractTy
aT = DeBruijn -> Index "tyvar" -> ValT AbstractTy
tyvar DeBruijn
Z Index "tyvar"
forall (ofWhat :: Symbol). Index ofWhat
ix0
aTOuter :: ValT AbstractTy
aTOuter :: ValT AbstractTy
aTOuter = DeBruijn -> Index "tyvar" -> ValT AbstractTy
tyvar (DeBruijn -> DeBruijn
S DeBruijn
Z) Index "tyvar"
forall (ofWhat :: Symbol). Index ofWhat
ix0
bT :: ValT AbstractTy
bT :: ValT AbstractTy
bT = DeBruijn -> Index "tyvar" -> ValT AbstractTy
tyvar DeBruijn
Z Index "tyvar"
forall (ofWhat :: Symbol). Index ofWhat
ix1
bTOuter :: ValT AbstractTy
bTOuter :: ValT AbstractTy
bTOuter = DeBruijn -> Index "tyvar" -> ValT AbstractTy
tyvar (DeBruijn -> DeBruijn
S DeBruijn
Z) Index "tyvar"
forall (ofWhat :: Symbol). Index ofWhat
ix1