Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trace removal re-implemented as a IR rewrite rule
- Loading branch information
Showing
4 changed files
with
35 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
plutus-core/plutus-ir/src/PlutusIR/Transform/RewriteRules/RemoveTrace.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{-# LANGUAGE BlockArguments #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
{-# LANGUAGE PatternSynonyms #-} | ||
|
||
module PlutusIR.Transform.RewriteRules.RemoveTrace | ||
( rewriteRuleRemoveTrace | ||
) where | ||
|
||
import PlutusCore.Default (DefaultFun) | ||
import PlutusCore.Default.Builtins qualified as Builtin | ||
import PlutusIR.Transform.RewriteRules.Common (pattern A, pattern B, pattern I) | ||
import PlutusIR.Transform.RewriteRules.Internal (RewriteRules (..)) | ||
|
||
rewriteRuleRemoveTrace :: RewriteRules uni DefaultFun | ||
rewriteRuleRemoveTrace = RewriteRules \_varsInfo -> \case | ||
B Builtin.Trace `I` _ty `A` _msg `A` arg -> pure arg | ||
term -> pure term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters