gallais / idris-tparsec

TParsec - Total Parser Combinators in Idris
https://gallais.github.io/idris-tparsec/
GNU General Public License v3.0
93 stars 10 forks source link

Use fresh lists to enforce uniqueness of lexer keywords ? #30

Open clayrat opened 4 years ago

clayrat commented 4 years ago

Fresh list is data structure defined by induction recursion for element types with a decidable equality.

Here's a PR to the Agda standard library with an implementation of fresh lists together with documentation & an updated version of the lexer example using fresh lists: agda/agda-stdlib#878

gallais commented 4 years ago

Note that it is crucial here to implement the generalised version of fresh lists that I have PR'd to the stdlib because we want to avoid duplicates not of pairs of string and token but of strings. So equality is not the freshness relation we are using here.

clayrat commented 2 years ago

There's an Idris implementation of fresh lists at https://github.com/ohad/collie/tree/main/src/Data/List