# Passing procedures of unknow arity across typed/untyped boundary

**URL:** <https://racket.discourse.group/t/passing-procedures-of-unknow-arity-across-typed-untyped-boundary/831>\
**Category:** Questions & Answers\
**Tags:** typed-racket\
**Created:** [March 27, 2022, 12:02pm UTC](https://racket.discourse.group/t/passing-procedures-of-unknow-arity-across-typed-untyped-boundary/831 "2022-03-27T12:02:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![scolobb](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/scolobb/32/108_2.png) [@scolobb](https://racket.discourse.group/u/scolobb)\
**Post date:** [March 28, 2022, 8:10am UTC](https://racket.discourse.group/t/passing-procedures-of-unknow-arity-across-typed-untyped-boundary/831/3 "2022-03-28T08:10:07Z")

</div>

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](https://racket.discourse.group/t/replicating-the-type-of-apply/770/3) 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.

---

_[View the full topic](https://racket.discourse.group/t/passing-procedures-of-unknow-arity-across-typed-untyped-boundary/831)._
