Skip to content

Commit

Permalink
fixup! chore(deps): bump actions/github-script from 6 to 7 (#5633)
Browse files Browse the repository at this point in the history
  • Loading branch information
Unisay committed Dec 12, 2024
1 parent 40a0e96 commit 7691051
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 2 additions & 0 deletions plutus-core/plutus-core/src/PlutusCore/Builtin/Result.hs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,12 @@ _UnliftingErrorVia :: Pretty err => err -> Prism' err UnliftingError
_UnliftingErrorVia err = iso (MkUnliftingError . display) (const err)
{-# INLINE _UnliftingErrorVia #-}

-- | See Note [Structural vs operational errors within builtins]
_StructuralUnliftingError :: AsBuiltinError err => Prism' err UnliftingError
_StructuralUnliftingError = _BuiltinUnliftingEvaluationError . _StructuralEvaluationError
{-# INLINE _StructuralUnliftingError #-}

-- | See Note [Structural vs operational errors within builtins]
_OperationalUnliftingError :: AsBuiltinError err => Prism' err UnliftingError
_OperationalUnliftingError = _BuiltinUnliftingEvaluationError . _OperationalEvaluationError
{-# INLINE _OperationalUnliftingError #-}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ instance NFData MlResult where
rnf _ = ()

instance Hashable MlResult where
hashWithSalt salt = const salt
hashWithSalt salt _MlResult = salt

millerLoop :: G1.Element -> G2.Element -> MlResult
millerLoop = coerce BlstBindings.millerLoop
Expand Down
27 changes: 12 additions & 15 deletions plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where
-- Pairs
toBuiltinMeaning _semvar FstPair =
let fstPairDenotation :: SomeConstant uni (a, b) -> BuiltinResult (Opaque val a)
fstPairDenotation (SomeConstant (Some (ValueOf uniPairAB xy))) = do
fstPairDenotation (SomeConstant (Some (ValueOf uniPairAB xy))) =
case uniPairAB of
DefaultUniPair uniA _ -> pure . fromValueOf uniA $ fst xy
_ ->
Expand All @@ -1452,7 +1452,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where

toBuiltinMeaning _semvar SndPair =
let sndPairDenotation :: SomeConstant uni (a, b) -> BuiltinResult (Opaque val b)
sndPairDenotation (SomeConstant (Some (ValueOf uniPairAB xy))) = do
sndPairDenotation (SomeConstant (Some (ValueOf uniPairAB xy))) =
case uniPairAB of
DefaultUniPair _ uniB -> pure . fromValueOf uniB $ snd xy
_ ->
Expand All @@ -1466,7 +1466,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where
-- Lists
toBuiltinMeaning _semvar ChooseList =
let chooseListDenotation :: SomeConstant uni [a] -> b -> b -> BuiltinResult b
chooseListDenotation (SomeConstant (Some (ValueOf uniListA xs))) a b = do
chooseListDenotation (SomeConstant (Some (ValueOf uniListA xs))) a b =
case uniListA of
DefaultUniList _ -> pure $ case xs of
[] -> a
Expand All @@ -1485,7 +1485,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where
-> Opaque val (a -> [a] -> b)
-> SomeConstant uni [a]
-> BuiltinResult (Opaque (HeadSpine val) b)
caseListDenotation z f (SomeConstant (Some (ValueOf uniListA xs0))) = do
caseListDenotation z f (SomeConstant (Some (ValueOf uniListA xs0))) =
case uniListA of
DefaultUniList uniA -> pure $ case xs0 of
[] -> headSpine z []
Expand All @@ -1503,7 +1503,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where
:: SomeConstant uni a -> SomeConstant uni [a] -> BuiltinResult (Opaque val [a])
mkConsDenotation
(SomeConstant (Some (ValueOf uniA x)))
(SomeConstant (Some (ValueOf uniListA xs))) = do
(SomeConstant (Some (ValueOf uniListA xs))) =
-- See Note [Structural vs operational errors within builtins].
case uniListA of
DefaultUniList uniA' -> case uniA `geq` uniA' of
Expand All @@ -1518,8 +1518,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where

toBuiltinMeaning _semvar HeadList =
let headListDenotation :: SomeConstant uni [a] -> BuiltinResult (Opaque val a)
headListDenotation (SomeConstant (Some (ValueOf uniListA xs))) = do
-- See Note [Structural vs operational errors within builtins].
headListDenotation (SomeConstant (Some (ValueOf uniListA xs))) =
case uniListA of
DefaultUniList uniA -> case xs of
[] -> fail "Expected a non-empty list but got an empty one"
Expand All @@ -1532,10 +1531,10 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where

toBuiltinMeaning _semvar TailList =
let tailListDenotation :: SomeConstant uni [a] -> BuiltinResult (Opaque val [a])
tailListDenotation (SomeConstant (Some (ValueOf uniListA xs))) = do
-- See Note [Structural vs operational errors within builtins].
tailListDenotation (SomeConstant (Some (ValueOf uniListA xs))) =
case uniListA of
DefaultUniList _ -> case xs of
DefaultUniList _argUni ->
case xs of
[] -> fail "Expected a non-empty list but got an empty one"
_ : xs' -> pure $ fromValueOf uniListA xs'
_ -> throwing _StructuralUnliftingError "Expected a list but got something else"
Expand All @@ -1546,12 +1545,10 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni DefaultFun where

toBuiltinMeaning _semvar NullList =
let nullListDenotation :: SomeConstant uni [a] -> BuiltinResult Bool
nullListDenotation (SomeConstant (Some (ValueOf uniListA xs))) = do
nullListDenotation (SomeConstant (Some (ValueOf uniListA xs))) =
case uniListA of
DefaultUniList _ -> pure $ null xs
_ ->
-- See Note [Structural vs operational errors within builtins].
throwing _StructuralUnliftingError "Expected a list but got something else"
DefaultUniList _argUni -> pure $ null xs
_ -> throwing _StructuralUnliftingError "Expected a list but got something else"
{-# INLINE nullListDenotation #-}
in makeBuiltinMeaning
nullListDenotation
Expand Down

0 comments on commit 7691051

Please sign in to comment.