case expressions/transfers

Stephen Weeks MLton@sourcelight.com
Wed, 9 Jan 2002 20:30:09 -0800


> the right fix is to modify the XML shrinker (or maybe just the
> closure converter).  I'm happy to do it if you haven't already.

I see you checked in a solution.  

I just checked in an alternate solution that I think is better, for
several reasons.  The only possibility for redundancy is in the
default -- there is no possibility in the cases.  So we only need to
check if the number of cases is equal to the number of constructors in
the datatype -- if so, then the default is redundant.  Thus, there is
only a need for a mapping from each con to the number of constructors
in its datatype.  Also, using a mapping from cons instead of tycons
eliminates the need for special casing of exceptions.  Also, it looks
like you missed the deleteExp in the case when the default is
redundant, as well as the property clear at the end of the program.
:-) 

Have a look.