[racket] [typed racket] type case

From: J. Ian Johnson (ianj at ccs.neu.edu)
Date: Thu Oct 20 14:14:55 EDT 2011

One way is to write an else branch that returns a value that is not the expected result type. Exhaustion of the elements of a union by previous branches would cause the typechecker to determine the reachability of that branch impossible and not report an error.
----- Original Message -----
From: Eric Tanter <etanter at dcc.uchile.cl>
To: Racket Users <users at racket-lang.org>
Sent: Thu, 20 Oct 2011 10:48:22 -0400 (EDT)
Subject: [racket] [typed racket] type case

Hi again,

Is there a mechanism to do an exhaustive type case?

I know I can use (cond [(type-pred? v) ...]

but of course I have no guarantee that I am exhaustive (and of course, doing pattern matching to destruct the value would be even nicer). 

Basically, I guess I'm after the typed version of PLAI's type-case.


-- Éric

  For list-related administrative tasks:

Posted on the users mailing list.