I have a list of sets and I want to take a union of those.
Something like the following
(apply set-union (list (set 'a) (set 'b)))
Which works and gives me the correct result (set 'a 'b)
Now if I try to write the same code like this:
(: l (Listof (Setof Symbol)))
(define l (list (set 'a) (set 'b)))
(apply set-union l)
Then I get the following error:
Type Checker: Bad arguments to function in `apply':
Domains: (Listof e)(Listof e) *
(Setof e)(Setof e) *
Arguments: (Listof (Setof Symbol))
How can I apply the set-union function to a list of sets?
I should mention that the same piece of code works with untyped racket language or with using language typed/racket/no-check, which is why I believe that it's definitely a typechecking issue.