@@ -596,11 +596,15 @@ prune proj (Case n alts)
596596 -- vs.
597597 -- f x = ... x!0 ...
598598 -- There's currently no code to handle this stuff. (TODO)
599− as@[ConCase cn i args sc] -> if proj && False then mkProj n 0 args sc
600− else Case n as
601− as@[SucCase cn sc] -> if proj then mkProj n (-1) [cn] sc
602− else Case n as
603− as@[ConstCase _ sc] -> prune proj sc
599+ --
600+ --as@[ConCase cn i args sc]
601+ -- | proj -> mkProj n 0 args (prune proj sc)
602+
603+ as@[SucCase cn sc]
604+ | proj -> mkProj n (-1) [cn] (prune proj sc)
605+
606+ as@[ConstCase _ sc]
607+ -> prune proj sc
604608
605609 -- Bit of a hack here! The default case will always be 0, make sure
606610 -- it gets caught first.
@@ -643,8 +647,7 @@ prune proj (Case n alts)
643647 forceArg n = App (App (App (P Ref (sUN "Force") Erased) Erased) Erased)
644648 (P Bound n Erased)
645649
646− mkProj n i [] sc = prune proj sc
647− mkProj n i (x : xs) sc = mkProj n (i + 1) xs (projRep x n i sc)
650+ mkProj n i xs sc = foldr (\x -> projRep x n i) sc xs
648651
649652 -- Change every 'n' in sc to 'n-1'
650653-- mkProjS n cn sc = prune proj (fmap projn sc) where