@avehtari ran into this today, where he wanted to define a covariance function that takes only a single argument.
The prohibition is purely syntactic, because (1.0) is already equivalent to 1.0 (e.g. a real).
Some options:
- Allow length 1 tuples with a required trailing comma (this is what e.g. Python does):
(1.0, )
- Add a helper function that creates length one tuples (e.g.
singleton_tuple(1.0))
- Allow a non-tuple tuple type as the forwarded arguments, in which case it looks for functions of only 1 argument.
All of these have a bit of a "magic" feel that makes me uneasy. The first is the most general, but we specifically avoided allowing this in the original tuples PR