Wed Apr 12 08:23:27 PDT 2006 [EMAIL PROTECTED]
* Improve pruning of case alternatives to account for GADTs
Consider
data T a where
T1 :: T Int
T2 :: T Bool
T3 :: T Char
f :: T Bool -> Int
f x = case x of
DEFAULT -> ...
T2 -> 3
Here the DEFAULT case covers multiple constructors (T1,T3), but none
of them can match a scrutinee of type (T Bool). So we can prune away
the default case altogether.
In implementing this, I re-factored this bit of the simplifier, elminiating
prepareAlts from SimplUtils, and putting all the work into simplAlts in
Simplify
The proximate cause was a program written by Manuel using PArrays
M ./compiler/coreSyn/CoreUtils.lhs -1 +13
M ./compiler/coreSyn/PprCore.lhs -2 +7
M ./compiler/simplCore/SimplUtils.lhs -159 +6
M ./compiler/simplCore/Simplify.lhs -28 +174
M ./compiler/types/Unify.lhs -2 +13
M ./compiler/utils/Maybes.lhs -1 +5
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc