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.
-Ian
----- Original Message -----
From: Eric Tanter <[email protected]>
To: Racket Users <[email protected]>
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.
Thanks,
-- Éric
_________________________________________________
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users
_________________________________________________
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users