polarity-lang / polarity

A Language with Dependent Data and Codata Types
https://polarity-lang.github.io
Apache License 2.0
50 stars 0 forks source link

Use generic ctx #264

Closed BinderDavid closed 2 months ago

BinderDavid commented 2 months ago

Use a generic implementation pub struct GenericCtx<T> { bounds: Vec<Vec<T>> } for contexts. This allows to remove some duplication, e.g. the implementation of idx_to_lvl and lvl_to_idx was the same for all 4 contexts, but the code couldn't be shared before.