alt-romes / alt-romes/hegg

Module wrapping e-graphs to use custom e-class-ids

未关闭
#23 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
Haskell
星标
98
派生
17
PR 合并指标
30 天内没有已合并 PR

描述

## Idea
It is arguably useful to be able to use e-class ids other than `ClassId`, so we could provide a module that wraps an e-graph and provides an interface to the e-graph in which e-class-ids are some user-defined type that supports lookups (e.g. instances `Ord`)

* If we want to associate some data with an e-class, but don't want it to live in the e-class data because it might be used very often, or inherently related to the Id rather than the e-class
* The user-type for Ids might allow discovering equalities on its own before the e-graph has to, since the `Eq` instance of the user type might take into consideration more data rather than just being an `Int`.
* TODO

This is mostly motivated by the use of e-graphs in GHC's pattern match checker, where it is potentially useful to use `Id`s as e-class ids.

## Alternatives
We could also say we won't do this as it is a bit ad-hoc and adds complexity, and that
* users can have a datatype wrap `ClassId` with more data they require, and then still use e-class ids *and/or*
* users can instead implement this layer of indirection themselves

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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