racket
racket copied to clipboard
[Feature Request] Ellipses for Parametric Contracts
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?