|
|
|
|
|
by Jtsummers
1611 days ago
|
|
Pre/post conditions are complementary to a type system. They can ensure logical properties that may not be encodable in your underlying type system (that is, essentially every mainstream statically typed language). Such as the relationship between two values in a collection. Trivial example, if you have a range such as [x,y] where x < y must hold, how would you convey that in any mainstream type system? |
|
[0]: https://wiki.haskell.org/Smart_constructors