[racket] typed racket: determining subset?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri Aug 19 19:01:45 EDT 2011

I'd do this by defining one in terms of the other.

The following expression will ensure the property, though:

(lambda () (ann (values (ann (error 'fail) T)) U))

This typechecks if and only if T is a subtype of U (regardless of T
and U).  The thunk ensures that it doesn't really raise an error.

On Fri, Aug 19, 2011 at 6:52 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
>
> Let's say that I have two union types, and want to statically make
> sure that one is a subset of the other, to prevent some silly bug.  Is
> there a way to express this directly in Typed Racket?
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users



--
sam th
samth at ccs.neu.edu



Posted on the users mailing list.