{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE LambdaCase #-}
module PlutusLedgerApi.Common.Versions
(
module PlutusLedgerApi.Common.ProtocolVersions
, PlutusLedgerLanguage (..)
, Version (..)
, ledgerLanguageIntroducedIn
, ledgerLanguagesAvailableIn
, plcVersionsIntroducedIn
, plcVersionsAvailableIn
, builtinsIntroducedIn
, builtinsAvailableIn
) where
import PlutusCore
import PlutusLedgerApi.Common.ProtocolVersions
import PlutusPrelude
import Codec.Serialise.Class (Serialise)
import Data.Map qualified as Map
import Data.Set qualified as Set
import NoThunks.Class (NoThunks)
import PlutusCore.Version (plcVersion100, plcVersion110)
import Prettyprinter
data PlutusLedgerLanguage =
PlutusV1
| PlutusV2
| PlutusV3
deriving stock (PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
(PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool)
-> (PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool)
-> Eq PlutusLedgerLanguage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
== :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
$c/= :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
/= :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
Eq, Eq PlutusLedgerLanguage
Eq PlutusLedgerLanguage =>
(PlutusLedgerLanguage -> PlutusLedgerLanguage -> Ordering)
-> (PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool)
-> (PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool)
-> (PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool)
-> (PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool)
-> (PlutusLedgerLanguage
-> PlutusLedgerLanguage -> PlutusLedgerLanguage)
-> (PlutusLedgerLanguage
-> PlutusLedgerLanguage -> PlutusLedgerLanguage)
-> Ord PlutusLedgerLanguage
PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
PlutusLedgerLanguage -> PlutusLedgerLanguage -> Ordering
PlutusLedgerLanguage
-> PlutusLedgerLanguage -> PlutusLedgerLanguage
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 :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Ordering
compare :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Ordering
$c< :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
< :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
$c<= :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
<= :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
$c> :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
> :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
$c>= :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
>= :: PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
$cmax :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> PlutusLedgerLanguage
max :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> PlutusLedgerLanguage
$cmin :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> PlutusLedgerLanguage
min :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> PlutusLedgerLanguage
Ord, Int -> PlutusLedgerLanguage -> ShowS
[PlutusLedgerLanguage] -> ShowS
PlutusLedgerLanguage -> String
(Int -> PlutusLedgerLanguage -> ShowS)
-> (PlutusLedgerLanguage -> String)
-> ([PlutusLedgerLanguage] -> ShowS)
-> Show PlutusLedgerLanguage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PlutusLedgerLanguage -> ShowS
showsPrec :: Int -> PlutusLedgerLanguage -> ShowS
$cshow :: PlutusLedgerLanguage -> String
show :: PlutusLedgerLanguage -> String
$cshowList :: [PlutusLedgerLanguage] -> ShowS
showList :: [PlutusLedgerLanguage] -> ShowS
Show, (forall x. PlutusLedgerLanguage -> Rep PlutusLedgerLanguage x)
-> (forall x. Rep PlutusLedgerLanguage x -> PlutusLedgerLanguage)
-> Generic PlutusLedgerLanguage
forall x. Rep PlutusLedgerLanguage x -> PlutusLedgerLanguage
forall x. PlutusLedgerLanguage -> Rep PlutusLedgerLanguage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PlutusLedgerLanguage -> Rep PlutusLedgerLanguage x
from :: forall x. PlutusLedgerLanguage -> Rep PlutusLedgerLanguage x
$cto :: forall x. Rep PlutusLedgerLanguage x -> PlutusLedgerLanguage
to :: forall x. Rep PlutusLedgerLanguage x -> PlutusLedgerLanguage
Generic, Int -> PlutusLedgerLanguage
PlutusLedgerLanguage -> Int
PlutusLedgerLanguage -> [PlutusLedgerLanguage]
PlutusLedgerLanguage -> PlutusLedgerLanguage
PlutusLedgerLanguage
-> PlutusLedgerLanguage -> [PlutusLedgerLanguage]
PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> [PlutusLedgerLanguage]
(PlutusLedgerLanguage -> PlutusLedgerLanguage)
-> (PlutusLedgerLanguage -> PlutusLedgerLanguage)
-> (Int -> PlutusLedgerLanguage)
-> (PlutusLedgerLanguage -> Int)
-> (PlutusLedgerLanguage -> [PlutusLedgerLanguage])
-> (PlutusLedgerLanguage
-> PlutusLedgerLanguage -> [PlutusLedgerLanguage])
-> (PlutusLedgerLanguage
-> PlutusLedgerLanguage -> [PlutusLedgerLanguage])
-> (PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> [PlutusLedgerLanguage])
-> Enum PlutusLedgerLanguage
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: PlutusLedgerLanguage -> PlutusLedgerLanguage
succ :: PlutusLedgerLanguage -> PlutusLedgerLanguage
$cpred :: PlutusLedgerLanguage -> PlutusLedgerLanguage
pred :: PlutusLedgerLanguage -> PlutusLedgerLanguage
$ctoEnum :: Int -> PlutusLedgerLanguage
toEnum :: Int -> PlutusLedgerLanguage
$cfromEnum :: PlutusLedgerLanguage -> Int
fromEnum :: PlutusLedgerLanguage -> Int
$cenumFrom :: PlutusLedgerLanguage -> [PlutusLedgerLanguage]
enumFrom :: PlutusLedgerLanguage -> [PlutusLedgerLanguage]
$cenumFromThen :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> [PlutusLedgerLanguage]
enumFromThen :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> [PlutusLedgerLanguage]
$cenumFromTo :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> [PlutusLedgerLanguage]
enumFromTo :: PlutusLedgerLanguage
-> PlutusLedgerLanguage -> [PlutusLedgerLanguage]
$cenumFromThenTo :: PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> [PlutusLedgerLanguage]
enumFromThenTo :: PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> PlutusLedgerLanguage
-> [PlutusLedgerLanguage]
Enum, PlutusLedgerLanguage
PlutusLedgerLanguage
-> PlutusLedgerLanguage -> Bounded PlutusLedgerLanguage
forall a. a -> a -> Bounded a
$cminBound :: PlutusLedgerLanguage
minBound :: PlutusLedgerLanguage
$cmaxBound :: PlutusLedgerLanguage
maxBound :: PlutusLedgerLanguage
Bounded)
deriving anyclass (PlutusLedgerLanguage -> ()
(PlutusLedgerLanguage -> ()) -> NFData PlutusLedgerLanguage
forall a. (a -> ()) -> NFData a
$crnf :: PlutusLedgerLanguage -> ()
rnf :: PlutusLedgerLanguage -> ()
NFData, Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo)
Proxy PlutusLedgerLanguage -> String
(Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo))
-> (Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo))
-> (Proxy PlutusLedgerLanguage -> String)
-> NoThunks PlutusLedgerLanguage
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
$cnoThunks :: Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo)
noThunks :: Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo)
$cwNoThunks :: Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo)
wNoThunks :: Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo)
$cshowTypeOf :: Proxy PlutusLedgerLanguage -> String
showTypeOf :: Proxy PlutusLedgerLanguage -> String
NoThunks, [PlutusLedgerLanguage] -> Encoding
PlutusLedgerLanguage -> Encoding
(PlutusLedgerLanguage -> Encoding)
-> (forall s. Decoder s PlutusLedgerLanguage)
-> ([PlutusLedgerLanguage] -> Encoding)
-> (forall s. Decoder s [PlutusLedgerLanguage])
-> Serialise PlutusLedgerLanguage
forall s. Decoder s [PlutusLedgerLanguage]
forall s. Decoder s PlutusLedgerLanguage
forall a.
(a -> Encoding)
-> (forall s. Decoder s a)
-> ([a] -> Encoding)
-> (forall s. Decoder s [a])
-> Serialise a
$cencode :: PlutusLedgerLanguage -> Encoding
encode :: PlutusLedgerLanguage -> Encoding
$cdecode :: forall s. Decoder s PlutusLedgerLanguage
decode :: forall s. Decoder s PlutusLedgerLanguage
$cencodeList :: [PlutusLedgerLanguage] -> Encoding
encodeList :: [PlutusLedgerLanguage] -> Encoding
$cdecodeList :: forall s. Decoder s [PlutusLedgerLanguage]
decodeList :: forall s. Decoder s [PlutusLedgerLanguage]
Serialise)
instance Pretty PlutusLedgerLanguage where
pretty :: forall ann. PlutusLedgerLanguage -> Doc ann
pretty = PlutusLedgerLanguage -> Doc ann
forall a ann. Show a => a -> Doc ann
viaShow
builtinsIntroducedIn :: Map.Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set.Set DefaultFun)
builtinsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
builtinsIntroducedIn = [((PlutusLedgerLanguage, MajorProtocolVersion), Set DefaultFun)]
-> Map
(PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [
((PlutusLedgerLanguage
PlutusV1, MajorProtocolVersion
alonzoPV), [DefaultFun] -> Set DefaultFun
forall a. Ord a => [a] -> Set a
Set.fromList [
DefaultFun
AddInteger, DefaultFun
SubtractInteger, DefaultFun
MultiplyInteger, DefaultFun
DivideInteger, DefaultFun
QuotientInteger, DefaultFun
RemainderInteger, DefaultFun
ModInteger, DefaultFun
EqualsInteger, DefaultFun
LessThanInteger, DefaultFun
LessThanEqualsInteger,
DefaultFun
AppendByteString, DefaultFun
ConsByteString, DefaultFun
SliceByteString, DefaultFun
LengthOfByteString, DefaultFun
IndexByteString, DefaultFun
EqualsByteString, DefaultFun
LessThanByteString, DefaultFun
LessThanEqualsByteString,
DefaultFun
Sha2_256, DefaultFun
Sha3_256, DefaultFun
Blake2b_256, DefaultFun
VerifyEd25519Signature,
DefaultFun
AppendString, DefaultFun
EqualsString, DefaultFun
EncodeUtf8, DefaultFun
DecodeUtf8,
DefaultFun
IfThenElse,
DefaultFun
ChooseUnit,
DefaultFun
Trace,
DefaultFun
FstPair, DefaultFun
SndPair,
DefaultFun
ChooseList, DefaultFun
MkCons, DefaultFun
HeadList, DefaultFun
TailList, DefaultFun
NullList,
DefaultFun
ChooseData, DefaultFun
ConstrData, DefaultFun
MapData, DefaultFun
ListData, DefaultFun
IData, DefaultFun
BData, DefaultFun
UnConstrData, DefaultFun
UnMapData, DefaultFun
UnListData, DefaultFun
UnIData, DefaultFun
UnBData, DefaultFun
EqualsData,
DefaultFun
MkPairData, DefaultFun
MkNilData, DefaultFun
MkNilPairData
]),
((PlutusLedgerLanguage
PlutusV2, MajorProtocolVersion
vasilPV), [DefaultFun] -> Set DefaultFun
forall a. Ord a => [a] -> Set a
Set.fromList [
DefaultFun
SerialiseData
]),
((PlutusLedgerLanguage
PlutusV2, MajorProtocolVersion
valentinePV), [DefaultFun] -> Set DefaultFun
forall a. Ord a => [a] -> Set a
Set.fromList [
DefaultFun
VerifyEcdsaSecp256k1Signature, DefaultFun
VerifySchnorrSecp256k1Signature
]),
((PlutusLedgerLanguage
PlutusV2, MajorProtocolVersion
changPlus1PV), [DefaultFun] -> Set DefaultFun
forall a. Ord a => [a] -> Set a
Set.fromList [
DefaultFun
IntegerToByteString, DefaultFun
ByteStringToInteger
]),
((PlutusLedgerLanguage
PlutusV3, MajorProtocolVersion
changPV), [DefaultFun] -> Set DefaultFun
forall a. Ord a => [a] -> Set a
Set.fromList [
DefaultFun
Bls12_381_G1_add, DefaultFun
Bls12_381_G1_neg, DefaultFun
Bls12_381_G1_scalarMul,
DefaultFun
Bls12_381_G1_equal, DefaultFun
Bls12_381_G1_hashToGroup,
DefaultFun
Bls12_381_G1_compress, DefaultFun
Bls12_381_G1_uncompress,
DefaultFun
Bls12_381_G2_add, DefaultFun
Bls12_381_G2_neg, DefaultFun
Bls12_381_G2_scalarMul,
DefaultFun
Bls12_381_G2_equal, DefaultFun
Bls12_381_G2_hashToGroup,
DefaultFun
Bls12_381_G2_compress, DefaultFun
Bls12_381_G2_uncompress,
DefaultFun
Bls12_381_millerLoop, DefaultFun
Bls12_381_mulMlResult, DefaultFun
Bls12_381_finalVerify,
DefaultFun
Keccak_256, DefaultFun
Blake2b_224, DefaultFun
IntegerToByteString, DefaultFun
ByteStringToInteger
]),
((PlutusLedgerLanguage
PlutusV3, MajorProtocolVersion
changPlus1PV), [DefaultFun] -> Set DefaultFun
forall a. Ord a => [a] -> Set a
Set.fromList [
DefaultFun
AndByteString, DefaultFun
OrByteString, DefaultFun
XorByteString, DefaultFun
ComplementByteString,
DefaultFun
ReadBit, DefaultFun
WriteBits, DefaultFun
ReplicateByte,
DefaultFun
ShiftByteString, DefaultFun
RotateByteString, DefaultFun
CountSetBits, DefaultFun
FindFirstSetBit,
DefaultFun
Ripemd_160
]),
((PlutusLedgerLanguage
PlutusV3, MajorProtocolVersion
futurePV), [DefaultFun] -> Set DefaultFun
forall a. Ord a => [a] -> Set a
Set.fromList [
DefaultFun
ExpModInteger,
DefaultFun
CaseList, DefaultFun
CaseData
])
]
plcVersionsIntroducedIn :: Map.Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set.Set Version)
plcVersionsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
plcVersionsIntroducedIn = [((PlutusLedgerLanguage, MajorProtocolVersion), Set Version)]
-> Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [
((PlutusLedgerLanguage
PlutusV1, MajorProtocolVersion
alonzoPV), [Version] -> Set Version
forall a. Ord a => [a] -> Set a
Set.fromList [ Version
plcVersion100 ]),
((PlutusLedgerLanguage
PlutusV3, MajorProtocolVersion
changPV), [Version] -> Set Version
forall a. Ord a => [a] -> Set a
Set.fromList [ Version
plcVersion110 ])
]
ledgerLanguageIntroducedIn :: PlutusLedgerLanguage -> MajorProtocolVersion
ledgerLanguageIntroducedIn :: PlutusLedgerLanguage -> MajorProtocolVersion
ledgerLanguageIntroducedIn = \case
PlutusLedgerLanguage
PlutusV1 -> MajorProtocolVersion
alonzoPV
PlutusLedgerLanguage
PlutusV2 -> MajorProtocolVersion
vasilPV
PlutusLedgerLanguage
PlutusV3 -> MajorProtocolVersion
changPV
ledgerLanguagesAvailableIn :: MajorProtocolVersion -> Set.Set PlutusLedgerLanguage
ledgerLanguagesAvailableIn :: MajorProtocolVersion -> Set PlutusLedgerLanguage
ledgerLanguagesAvailableIn MajorProtocolVersion
searchPv =
(PlutusLedgerLanguage -> Set PlutusLedgerLanguage)
-> [PlutusLedgerLanguage] -> Set PlutusLedgerLanguage
forall m a. Monoid m => (a -> m) -> [a] -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap PlutusLedgerLanguage -> Set PlutusLedgerLanguage
ledgerVersionToSet [PlutusLedgerLanguage]
forall a. (Enum a, Bounded a) => [a]
enumerate
where
ledgerVersionToSet :: PlutusLedgerLanguage -> Set.Set PlutusLedgerLanguage
ledgerVersionToSet :: PlutusLedgerLanguage -> Set PlutusLedgerLanguage
ledgerVersionToSet PlutusLedgerLanguage
ll
| PlutusLedgerLanguage -> MajorProtocolVersion
ledgerLanguageIntroducedIn PlutusLedgerLanguage
ll MajorProtocolVersion -> MajorProtocolVersion -> Bool
forall a. Ord a => a -> a -> Bool
<= MajorProtocolVersion
searchPv = PlutusLedgerLanguage -> Set PlutusLedgerLanguage
forall a. a -> Set a
Set.singleton PlutusLedgerLanguage
ll
| Bool
otherwise = Set PlutusLedgerLanguage
forall a. Monoid a => a
mempty
plcVersionsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set.Set Version
plcVersionsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set Version
plcVersionsAvailableIn PlutusLedgerLanguage
thisLv MajorProtocolVersion
thisPv = [Set Version] -> Set Version
forall m. Monoid m => [m] -> m
forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m
fold ([Set Version] -> Set Version) -> [Set Version] -> Set Version
forall a b. (a -> b) -> a -> b
$ Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
-> [Set Version]
forall k a. Map k a -> [a]
Map.elems (Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
-> [Set Version])
-> Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
-> [Set Version]
forall a b. (a -> b) -> a -> b
$
((PlutusLedgerLanguage, MajorProtocolVersion) -> Bool)
-> Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
-> Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
forall k a. (k -> Bool) -> Map k a -> Map k a
Map.takeWhileAntitone (PlutusLedgerLanguage, MajorProtocolVersion) -> Bool
plcVersionAvailableIn Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version)
plcVersionsIntroducedIn
where
plcVersionAvailableIn :: (PlutusLedgerLanguage, MajorProtocolVersion) -> Bool
plcVersionAvailableIn :: (PlutusLedgerLanguage, MajorProtocolVersion) -> Bool
plcVersionAvailableIn (PlutusLedgerLanguage
introducedInLv,MajorProtocolVersion
introducedInPv) =
PlutusLedgerLanguage
introducedInLv PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
forall a. Ord a => a -> a -> Bool
<= PlutusLedgerLanguage
thisLv Bool -> Bool -> Bool
&& MajorProtocolVersion
introducedInPv MajorProtocolVersion -> MajorProtocolVersion -> Bool
forall a. Ord a => a -> a -> Bool
<= MajorProtocolVersion
thisPv
builtinsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set.Set DefaultFun
builtinsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set DefaultFun
builtinsAvailableIn PlutusLedgerLanguage
thisLv MajorProtocolVersion
thisPv = Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
-> Set DefaultFun
forall m.
Monoid m =>
Map (PlutusLedgerLanguage, MajorProtocolVersion) m -> m
forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m
fold (Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
-> Set DefaultFun)
-> Map
(PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
-> Set DefaultFun
forall a b. (a -> b) -> a -> b
$
((PlutusLedgerLanguage, MajorProtocolVersion)
-> Set DefaultFun -> Bool)
-> Map
(PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
-> Map
(PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
forall k a. (k -> a -> Bool) -> Map k a -> Map k a
Map.filterWithKey (Bool -> Set DefaultFun -> Bool
forall a b. a -> b -> a
const (Bool -> Set DefaultFun -> Bool)
-> ((PlutusLedgerLanguage, MajorProtocolVersion) -> Bool)
-> (PlutusLedgerLanguage, MajorProtocolVersion)
-> Set DefaultFun
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (PlutusLedgerLanguage, MajorProtocolVersion) -> Bool
alreadyIntroduced) Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun)
builtinsIntroducedIn
where
alreadyIntroduced :: (PlutusLedgerLanguage, MajorProtocolVersion) -> Bool
alreadyIntroduced :: (PlutusLedgerLanguage, MajorProtocolVersion) -> Bool
alreadyIntroduced (PlutusLedgerLanguage
introducedInLv,MajorProtocolVersion
introducedInPv) =
PlutusLedgerLanguage
introducedInLv PlutusLedgerLanguage -> PlutusLedgerLanguage -> Bool
forall a. Ord a => a -> a -> Bool
<= PlutusLedgerLanguage
thisLv Bool -> Bool -> Bool
&& MajorProtocolVersion
introducedInPv MajorProtocolVersion -> MajorProtocolVersion -> Bool
forall a. Ord a => a -> a -> Bool
<= MajorProtocolVersion
thisPv