Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement return type "inference" for functions at call sites #25
This was referenced
May 11, 2017
While I appreciate the reliability and tried-and-testedness of using an existing proven type inference algorithm, for a few reasons I don't want to proceed with this in 0.1.0.
Firstly, and probably most significantly, I have a lot of time consuming reading up to do on these algorithms and the background theory, which I don't want to do before this first release.
Secondly, at first glance, I feel like there will need to be some changes to the algorithms anyway, primarily because I feel like they were designed for static/strict type systems (functions can only return a certain type, no unions, variables once bound cannot change type, etc.) and if I'm right it would mean even more time consumed before this is done.
Thirdly, the current type system is really very simple. There are only two levels of types: concrete single types or the
Finally, 0.1.0 was about filling in gaps in the existing features. Type checking and inference (read: propagation) work as of now, and at the
Considering the above comments as well as the haste in which 00dee25 was written, I'm working on removing type annotations/hints and instead only trying to infer. This will probably simplify and shorten the code significantly, making it easier to edit the typechecker in a future release.