Nadrieril / dhall-rust

Maintainable configuration files, for Rust users
Other
303 stars 27 forks source link

Decouple main expression types #131

Closed Nadrieril closed 4 years ago

Nadrieril commented 4 years ago

Yet another massive refactor. This time, I decoupled typechecking from normalization: Value does not need to laboriously keep track of types anymore. Now we can normalize without typechecking if we want, though I don't know if that's a desirable property. I also renamed intermediate expression types; now we have Expr, Hir, Tir (for typecheck) and Nir (for normalization). This not only simplifies quite a few things, it also again makes the code easier to follow and amend. Name resolution is now done as part of the resolve phase, that previously only did import resolution. I should document all that at some point, but I'm having too much fun refactoring for now.