Passing procedures of unknow arity across typed/untyped boundary

You are right @benknoble , the meaning of "unknown arity" is ambiguous in my original post. What I want is a function—e.g. do—which takes as an argument another function—e.g. f—whose arity do does not know in advance.

To give some context, I have a collection of functions for tabulating other functions, i.e. producing a list of the values these functions take on a given set of inputs. My final goal is constructing truth tables.

Writing this in untyped Racket is really easy: just loop over the functions and over the possible inputs and apply the functions to the inputs. Things become more difficult in Typed Racket, as apply is treated specially and so I cannot reuse its type.

Right now I am looking for ways to write weaker types which would still allow me to type tabulating functions.

My fallback solution now is using types like (-> Boolean * Boolean) and supplying the arity of the tabulated function as an argument, but I'd be glad to have something more elegant.