qi icon indicating copy to clipboard operation
qi copied to clipboard

[Feature Request] more precise procedure arity

Open NoahStoryM opened this issue 2 years ago • 2 comments

What version of Racket are you using?

v8.6 [cs]

What program did you run?

Welcome to Racket v8.6 [cs].
> (require qi)
> (procedure-arity (☯ (==* add1 add1)))
(arity-at-least 0)
> (procedure-arity (☯ (-< add1 add1)))
(arity-at-least 0)

What should have happened?

Welcome to Racket v8.6 [cs].
> (require qi)
> (procedure-arity (☯ (==* add1 add1)))
2
> (procedure-arity (☯ (-< add1 add1)))
1

NoahStoryM avatar Aug 29 '22 12:08 NoahStoryM

Would this be addressed by racket/racket#4416?

countvajhula avatar Aug 31 '22 02:08 countvajhula

With that change, the procedures returned by compose will work fine:

Welcome to Racket v8.6 [cs].
> (require qi)
> (procedure-arity (flow (~> cons)))
2
> (procedure-arity (flow (~> cons +)))
2

To get more precise arity of -<, maybe something like arity-union is needed.

NoahStoryM avatar Aug 31 '22 02:08 NoahStoryM