[racket] TR: predicate for a Float ?
At Fri, 6 Jan 2012 08:47:39 -0800,
John Clements wrote:
> 1) Not all of the types printed in (:print-type Foo) are necessarily
> bound in the user code, right? I tried at one point substituting the
> result of (:print-type something-or-other) for something-or-other, and
> got a message about an unbound variable.
They should be. Which one was unbound? That sounds like a bug.
> 2) It would be great to have a one-sentence description of each
> type. In my case, for instance, I clearly did not deduce that the
> 'single' in 'Positive-Single-Flonum' referred to single-precision.
I'll add something like that to the docs. Some types are pretty
self-explanatory, but I agree that the single-precision floating-point
types are not obvious.
> 3) What would be *really* awesome would be a tool that accepted a
> function and a desired output type, and pruned the type of the
> function so that I could discover what kind of input I had to
> provide in order to get that kind of output. I find myself
> repeatedly plowing through enormous types trying to find a clause
> that will do what I want.
Would `:query-result-type' do what you want?
Vincent