Refinement types #238
Labels
Area/Lang
Relates to the Ballerina language specification
status/idea
An idea that is not yet a worked-out proposal
Type/Improvement
Enhancement to language design
Milestone
The idea is that you can use a limited form of expression to constrain a type. The syntax could look like this:
The difficulty is that static type checking becomes very challenging. How would you tell that the type of positiveInt + positiveInt is a positiveInt? One approach is to use an SMT solver.
See paper "Semantic Subtyping with an SMT Solver" by Bierman, Gordon & Langworthy from Microsoft:
https://www.microsoft.com/en-us/research/wp-content/uploads/2010/12/icfp09i-bierman.pdf
This is probably too researchy for Ballerina at the moment, but I want to have an issue to capture the general concept.
Edited: fully static is too researchy, but we don't have to do that.
The text was updated successfully, but these errors were encountered: