From 2c984b0eb64800eed57a50b4b5f8a4c78ab15097 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 21 Jun 2009 17:47:36 +0200 Subject: [PATCH] Make beta reduction of Case expressions work for type arguments. Previously, splitFunTy was used, which assumes a function type, while a type argument is applied to a forall type instead of a function type. Using applyTypeToArg handles all this for us. --- Normalize.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Normalize.hs b/Normalize.hs index cbe2090..a011991 100644 --- a/Normalize.hs +++ b/Normalize.hs @@ -62,7 +62,7 @@ beta (App (Let binds expr) arg) = change $ Let binds (App expr arg) beta (App (Case scrut b ty alts) arg) = change $ Case scrut b ty' alts' where alts' = map (\(con, bndrs, expr) -> (con, bndrs, (App expr arg))) alts - (_, ty') = Type.splitFunTy ty + ty' = CoreUtils.applyTypeToArg ty arg -- Leave all other expressions unchanged beta expr = return expr -- Perform this transform everywhere -- 2.30.2