Merge git://github.com/darchon/clash into cλash
[matthijs/master-project/cλash.git] / Normalize.hs
index 0004ee3a9c01a90060173d6978abc5f7891873b6..93369213e5260f4a3661e1f67769713d00ec4c76 100644 (file)
@@ -285,13 +285,12 @@ caseremove expr = return expr
 caseremovetop = everywhere ("caseremove", caseremove)
 
 --------------------------------
--- Application simplification
+-- Argument extraction
 --------------------------------
--- Make sure that all arguments in an application are simple variables.
+-- Make sure that all arguments of a representable type are simple variables.
 appsimpl, appsimpltop :: Transform
--- Don't simplify arguments that are already simple. Do simplify datacons,
--- however, since we can't portmap literals.
-appsimpl expr@(App f (Var v)) | not $ Id.isDataConWorkId v = return expr
+-- Don't simplify arguments that are already simple.
+appsimpl expr@(App f (Var v)) = return expr
 -- Simplify all non-applicable (to prevent loops with inlinefun) arguments,
 -- except for type arguments (since a let can't bind type vars, only a lambda
 -- can). Do this by introducing a new Let that binds the argument and passing