Skip to content

Commit 36ed5c9

Browse files
committed
Remove unused haskellValueToTerm function
1 parent 979e27e commit 36ed5c9

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

plutus-benchmark/common/PlutusBenchmark/Common.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module PlutusBenchmark.Common
1010
, toAnonDeBruijnTerm
1111
, toNamedDeBruijnTerm
1212
, compiledCodeToTerm
13-
, haskellValueToTerm
1413
, benchProgramCek
1514
, cekResultMatchesHaskellValue
1615
, mkEvalCtx
@@ -39,7 +38,8 @@ import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (..))
3938
import PlutusCore.Evaluation.Machine.ExBudgetingDefaults qualified as PLC
4039
import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (..), ExMemory (..))
4140

42-
import PlutusTx.Test.Util.Compiled
41+
import PlutusTx.Test.Util.Compiled (Program, Term, cekResultMatchesHaskellValue, compiledCodeToTerm,
42+
toAnonDeBruijnProg, toAnonDeBruijnTerm, toNamedDeBruijnTerm)
4343
import UntypedPlutusCore qualified as UPLC
4444
import UntypedPlutusCore.Evaluation.Machine.Cek as Cek
4545
import UntypedPlutusCore.Evaluation.Machine.Cek qualified as UPLC

plutus-tx/testlib/PlutusTx/Test/Util/Compiled.hs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module PlutusTx.Test.Util.Compiled (
88
toAnonDeBruijnProg,
99
toNamedDeBruijnTerm,
1010
compiledCodeToTerm,
11-
haskellValueToTerm,
1211
cekResultMatchesHaskellValue,
1312
)
1413
where
@@ -49,12 +48,6 @@ We use this a lot.
4948
compiledCodeToTerm :: Tx.CompiledCodeIn DefaultUni DefaultFun a -> Term
5049
compiledCodeToTerm code = let UPLC.Program _ _ body = Tx.getPlcNoAnn code in body
5150

52-
{-| Lift a Haskell value to a PLC term. The constraints get a bit out of control
53-
if we try to do this over an arbitrary universe.
54-
-}
55-
haskellValueToTerm :: (Tx.Lift DefaultUni a) => a -> Term
56-
haskellValueToTerm = compiledCodeToTerm . Tx.liftCodeDef
57-
5851
{-| Evaluate a PLC term and check that the result matches a given Haskell value
5952
(perhaps obtained by running the Haskell code that the term was compiled
6053
from). We evaluate the lifted Haskell value as well, because lifting may
@@ -69,7 +62,9 @@ cekResultMatchesHaskellValue
6962
-> hask
7063
-> k
7164
cekResultMatchesHaskellValue actual matches expected =
72-
unsafeRunTermCek actual `matches` unsafeRunTermCek (haskellValueToTerm expected)
65+
matches
66+
(unsafeRunTermCek actual)
67+
(unsafeRunTermCek (compiledCodeToTerm (Tx.liftCodeDef expected)))
7368
where
7469
unsafeRunTermCek :: Term -> EvaluationResult Term
7570
unsafeRunTermCek =

0 commit comments

Comments
 (0)