[racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type

From: keydana at gmx.de (keydana at gmx.de)
Date: Mon Jun 7 16:08:09 EDT 2010

> 
> Try the other way around:
> 
> (truncate (inexact->exact n))
> 


Finally I've found the time to try this - but it gives me a Real (same with round):

(truncate (inexact->exact 1.222))
- : Real
1

So I still have the typing error, the substring function insisting on an Integer...

One general question...
Having right now read through the "untyped" http://docs.racket-lang.org/reference/numbers.html page, which introduces the exact vs. inexact concept and the sets of numbers from mathematics as orthogonal, I'd be curious about how TS handles this in the type hierarchy?

Also, in practice,  think it'd be helpful to show the inclusion hierarchy for numeric types in the typed scheme reference... in fact I just realized that even in my ultra-simplistic representation, where I just want to have one "number" type (like the sql number type), I should think more about which one to use, whether it should be an exact or an inexact one... but I'm not really sure which possibilities there are for both options (e.g., I assume Number and Real are inexact, and Exact-Rational is the farthest I can get away from Integer with exact numbers? -- BTW, Exact-Rational is not in the docs, I just see it in drscheme). 

Thanks a lot as always,
Sigrid




Posted on the users mailing list.