Thu Jan 11 01:15:33 PST 2007 [EMAIL PROTECTED] * Make the LiberateCase transformation understand associated types Consider this FC program: data family AT a :: * data instance AT Int = T1 Int Int f :: AT Int -> Int f t = case t of DEFAULT -> <body> We'd like to replace the DEFAULT by a use of T1, so that if we scrutinise t inside <body> we share the evaluation: f t = case (t `cast` co) of T1 x y -> <body> I decided to do this as part of the liberate-case transformation, which is already trying to avoid redundant evals. The new transformation requires knowledge of the family instance environment, so I had to extend ModGuts to carry the fam_inst_env, and put that envt into the liberate-case environment. Otherwise it's all pretty straightforward.
M ./compiler/deSugar/Desugar.lhs -34 +36 M ./compiler/main/HscTypes.lhs -1 +5 M ./compiler/simplCore/LiberateCase.lhs -73 +160 M ./compiler/simplCore/SimplCore.lhs -1 +3 M ./compiler/typecheck/TcRnDriver.lhs +1 _______________________________________________ Cvs-ghc mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/cvs-ghc