Open TomasMikula opened 4 years ago
Would you still store the original user defined term?
Currently, it is not stored and the pretty printed version might differ (beyond just formatting) from the original source. So the problem exists regardless of this proposal. This proposal would just make the average discrepancy between source term and pretty printed codebase term bigger.
My personal opinion is:
forall
s in my source code.This seems reasonable; do you happen to know where we are currently in terms of the pre-requisites you mentioned?
Unison's type inference is complex enough to not trust any particular implementation. However, once (untrusted) type inference fills in all the "gaps" (type applications,
forall
s), a straightforward (trusted) procedure could verify that the result of type inference is well-typed.Aside: Programs without gaps also make it simpler to implement type-preserving manipulations.
Aside: Things like codebase format or hashes would no longer be influenced by type inference, since only gap-free programs would be hashed or stored in the codebase. This non-dependence on type inference would in turn allow alternative type inference implementations (because if one wants sufficiently different syntax, they might need a different type inference algorithm).
Prerequisites to implement such verification procedure include at least:
Term
without gaps;Term
s ability to represent explicit type application andforall
s (Λ-abstraction).