[Feature Request] Ellipses for Parametric Contracts
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 5.2k
- Forks
- 698
- Avg merge
- 18h 34m
- Merged PRs (30d)
- 5
Description
I would like to endow apply and other such procedures
with more precise contracts, as seen below.
(define/contract apply/contract
(parametric->/c (src ... dst)
(-> (-> src ... dst)
(list/c src ...)
dst))
apply)
Alas, I cannot, because parametric->/c does not support ... or
any other mechanism for binding arbitrarily many type parameters.
It seems that I have to ignore the domain completely, as shown below.
(define/contract apply/contract
(parametric->/c (dst)
(-> (unconstrained-domain-> dst)
list?
dst))
apply)
Is this the best I can do right now?
Could support for ellipses be added in the future?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files, tests, or entry points are identified in the issue. Begin by locating the implementation and tests for parametric contracts and determine how ellipses could bind arbitrarily many parameters; done means supporting the requested contract form with coverage for the apply example.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100