X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Normalize.hs;h=cceefc0cf7baf76c4135da6ef12cc7f9c5922988;hb=757befa0b3e9765ad3eca2990df8a790e187326c;hp=9aedb4b856a17f8292241262df1f9622527efb9a;hpb=3f4773d25a4c44a0e4c9503806562a6741da3508;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/Normalize.hs b/Normalize.hs index 9aedb4b..cceefc0 100644 --- a/Normalize.hs +++ b/Normalize.hs @@ -43,13 +43,14 @@ import Pretty -- η abstraction -------------------------------- eta, etatop :: Transform +eta expr | is_fun expr && not (is_lam expr) = do eta expr | is_fun expr && not (is_lam expr) = do let arg_ty = (fst . Type.splitFunTy . CoreUtils.exprType) expr id <- mkInternalVar "param" arg_ty change (Lam id (App expr (Var id))) -- Leave all other expressions unchanged eta e = return e -etatop = notapplied ("eta", eta) +etatop = notappargs ("eta", eta) -------------------------------- -- β-reduction