[racket] TR: too-narrow type in / ?

From: Vincent St-Amour (stamourv at ccs.neu.edu)
Date: Tue Feb 3 20:51:55 EST 2015

That kind of pattern in the type usually happens due to underflow. In
this case, however, I don't see how it could cause problems.

A frequent problem case is -0.0, which (for closure property reasons) is
considered non-negative. But in this case, it's acceptable both as an
input and as an output.

I'll look into this, and possibly relax the type (and others like it).

Thanks for the report!

Vincent



At Tue, 3 Feb 2015 15:23:13 -0800,
John Clements wrote:
> 
> 
> I'm dividing a Nonnegative-Real by an Index, and I want to get back a
> Nonnegative-Real. The type of / contains this clause:
> 
> (-> Positive-Real Positive-Real * Nonnegative-Real)
> 
> It appears to me that the first term here should be "Nonnegative-Real",
> rather than "Positive-Real"... that is, this type:
> 
> (-> Nonnegative-Real Positive-Real * Nonnegative-Real)
> 
> Am I missing something obvious here?
> 
> (Naturally, I can insert a dynamic check, it just seems unnecessary...)
> 
> Thanks!
> 
> John
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.