u/curtisfin r/ProgrammingLanguages • Recommends
On “Property promises?”
These are often called "contracts". They are typically enabled by one of two type-system features:
* Refinement types
* Dependent types
Whiley is a teaching language that uses Z3 to check function contracts at compile-time. Ada SPARK is another language that checks contracts at compile time.
Other languages with dependent types include Idris, F\*, Coq, and Agda.
Other languages with refinement types include Liquid Haskell, F\*, and Dafny.
There is not a bright line that separates the different approaches.
Basically, dependent types allow you to refer to expressions in your type language. So, I can not just have a `ListString`, I can have a `ListString, len(myOtherList)`.
Refine…