countvajhula / social-contract

High-level, composable syntax for describing contracts in Racket.
3 stars 1 forks source link

Ability to parametrize non-essential aspects of the contracts #2

Open countvajhula opened 3 years ago

countvajhula commented 3 years ago

These contracts represent the ideas behind certain types of programming entities such as binary functions. As such, wherever relevant, they employ generic contracts instead of type-specific ones. For instance, contracts involving sequences employ the generic sequence contract from data/collection. It may be useful (e.g. possibly for performance) to be able to indicate a type-specific sequence contract such as list? or vector? in such contracts instead, so that for instance we could use map/c but specifically ensure a mapping function over a list. These non-essential parameters could be accepted as keyword arguments or in a subform.

Note: for sequences, these considerations apply to both simple contracts like list? as well as parametrically polymorphic ones like listof.