I am trying to build lists of structs with apply in Typed Racket but cannot figure out how to make it work. My guess is that it has to do with the problem with polymorphic functions but I can't figure out a workaround.
This works:
(struct tt ([a : Integer]
[b : Integer]))
(apply tt '(1 2))
But this doesn't (edited):
(struct tt2 ([a : String]
[b : (Vectorof Any)]))
(apply tt2 (list "A" (vector 1 2 2)))
With the error:
/usr/share/racket/collects/racket/private/kw.rkt:979:25: Type Checker: Bad
arguments to function in `apply':
Domain: String (Vectorof Any)
Arguments: (List String (Vector Integer Integer Integer))
in: (#%app apply tt23 (#%app list (quote "A") (#%app vector (quote 1) (quote 2) (quote 2))))
Is there any solution for this?