[plt-scheme] The perfect teaching language--Is this too much to ask for?

From: Sam TH (samth at ccs.neu.edu)
Date: Sat Jun 13 18:03:47 EDT 2009

On Sat, Jun 13, 2009 at 5:45 PM, Todd O'Bryan<toddobryan at gmail.com> wrote:
>> N
> N
>> (type-of 3)
> N
>> (type-of -4)
> Integer
>> (is-of-type 3 Integer)
> true
>> (type N)
> Type
>> (U N Integer)
> Integer
>> (U true false)
> Boolean

You haven't given any examples of computing with the types.  It would
certainly be possible to make all of these work in Typed Scheme,
although it would probably look more like:

> (:type N)

or something similar.

But if you really want to compute with the types, like this:

(if (equal? (type-of 3) (type-of -3)) 'yes 'no)

then that's more difficult to support, and if you want to do something
like this:

(: x (if stuff? Number String))
(define x ...)

then static checking is suddenly much harder.

So, I would say, try to come up with specific use cases for
computation with types, and then your question will be easier to
sam th
samth at ccs.neu.edu

Posted on the users mailing list.