countvajhula / social-contract

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

ABB cases that aren't constructors #3

Closed countvajhula closed 3 years ago

countvajhula commented 3 years ago

There are some abb type cases which may not be constructors, e.g. folds and generator-zip-with. How should we think about these? In form they are the same as constructors, yet, we may not want to think of them that way -- or should we?

countvajhula commented 3 years ago

These are now supported in the self-map/c form, where (like many other forms) additional arguments can be indicated using a "paramspec," which indicates the argument types and whether they are to be accepted at the head or the tail of the argument list.

Arguably, this notion of self-map should replace the constructor altogether since constructors are in fact self-maps parametrized by the primitives. It may be unnecessary to have the more connoted "constructor" forms.