alt-romes / hegg

Fast equality saturation in Haskell
https://hackage.haskell.org/package/hegg
BSD 3-Clause "New" or "Revised" License
75 stars 8 forks source link

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

Open alt-romes opened 1 year ago

alt-romes commented 1 year ago

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)

This is mostly motivated by the use of e-graphs in GHC's pattern match checker, where it is potentially useful to use Ids 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