Discuss: PlutusTx Eq instance generation should delegate to BuiltinData equality
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- haskell
- 领域
- blockchain, tooling
调研方向
检查现有的 PlutusTx Eq 实例生成,并将其与 issue 中展示的 PlutusData 相等性方法进行比较。阅读 plutus-ledger-api/src/PlutusLedgerApi/V2/Tx.hs 中引用的实现,然后确定应如何规定 Set 和 Map 等类型的规范表示,之后再决定什么才算完成。
由索引模型根据 Issue 内容生成。
描述
In Plutarch the general consensus is that we perform Eq by simply delegating to the underling PlutusData representation.
instance PEq FooTrivial where
(#==) = \l r -> pdata l #== pdata r
PlutusData equality operation is a builtin which is naturally much more performant then doing the obvious field by field comparisons (which is done in PlutusTx PLA types and is generally a practice adopted https://github.com/IntersectMBO/plutus/blob/b34d6ca2c4bbe54c324337eb813a5f6a522b475c/plutus-ledger-api/src/PlutusLedgerApi/V2/Tx.hs#L84).
However, we do assume that there's a single canonical PlutusData representation for all types, which might not be the case for semantically richer types like Set or Map (for example, the underlying AssocMap PlutusData representation can use ascending or descending ordering etc). This is solved by agreeing on a well defined PlutusData representation for any type that might be ambiguous in that regard.
cc @peter-mlabs
- 主要语言
- Haskell
- 星标
- 32
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mlabs-haskell/lambda-buffers 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
mlabs-haskell/lambda-buffers#296 ·
-
难度 5/5 一周以上 新手友好度 20/100
mlabs-haskell/lambda-buffers#295 ·
-
难度 4/5 3-5 天 新手友好度 20/100
mlabs-haskell/lambda-buffers#294 ·
-
Dykstra HF 未关闭
难度 4/5 3-5 天 新手友好度 35/100
mlabs-haskell/lambda-buffers#293 ·
-
Nix-free path 未关闭devops
难度 5/5 一周以上 新手友好度 25/100
mlabs-haskell/lambda-buffers#292 ·
查看 mlabs-haskell/lambda-buffers 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 76/100
severo/awesome-parquet#50 ·
-
typst-0.12 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
commercialhaskell/stackage#8127 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
input-output-hk/haskell.nix#2573 ·
-
docs
难度 1/5 1 小时以内 新手友好度 85/100
-
needs triage type: bug
难度 2/5 1-3 小时 新手友好度 70/100