[racket-dev] math collection [was: Hyperbolic functions]

From: Neil Toronto (neil.toronto at gmail.com)
Date: Tue Jun 26 20:17:20 EDT 2012

Ten minutes in, I've hit a snag. I'd like the stuff in math/functions to 
have precise types. For example, log1p could have the type

   (case-> (Zero -> Zero)
           (Float -> Float)
           (Real -> Real))

It was easy to get the implementation to typecheck, but when I tried to 
plot it in untyped Racket, I got this:

   Type Checker: The type of log1p cannot be converted to a contract in: 
log1p

I really don't want to have two versions of the library. Could TR use 
the most general type (Real -> Real) as the contract? Or would that be 
unsound?

Neil ⊥

Posted on the dev mailing list.