alt-romes / alt-romes/hegg

Rename {find,canonicalize} to unsafe{Find,Canonicalize}

Aperta
#1 4 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Haskell
Stelle
98
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello, and thanks for the good work.

This is a design proposal

Both `find` and `canonicalize`, as defined, are abstraction breaking, because the data structure is not in a sound state if you don't call `rebuild` previously. My proposal, in keeping with the spirit of Haskell of correctness first is that:

- the functions named `find` and `canonicalize` should call `rebuild` before querying the data structure (note: in the case where the data structure is already rebuilt, then the work list is empty, therefore `rebuild` will be very fast anyway)
- for the sake of performance tuning, direct queries to the data structure, called `unsafeFind` and `unsafeCanonicalize` would be introduced. With the documentation explaining that the onus is on the programmer to only call them on a “rebuilt” E-graph.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.