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.
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?
orvector?
in such contracts instead, so that for instance we could usemap/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 likelistof
.