Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Discuss: PlutusTx Eq instance generation should delegate to BuiltinData equality

未关闭
#236 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
haskell

调研方向

检查现有的 PlutusTx Eq 实例生成,并将其与 issue 中展示的 PlutusData 相等性方法进行比较。阅读 plutus-ledger-api/src/PlutusLedgerApi/V2/Tx.hs 中引用的实现,然后确定应如何规定 Set 和 Map 等类型的规范表示,之后再决定什么才算完成。

由索引模型根据 Issue 内容生成。

描述

codegen plutustx

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mlabs-haskell/lambda-buffers 的其他 Issue

查看 mlabs-haskell/lambda-buffers 的全部 Issue

相似的 Issue

更多 Haskell Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。