X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FNormalize%2FNormalizeTypes.hs;h=90592526f507b63353e0d4bad2cf6c3ee20fa8fa;hb=2e46e22eb0971c345e592314bd33729902e94d21;hp=3affc870d75d0f2fa8a9655a7d93a561fbfd7892;hpb=f3951a1376fc7d7f8addbe9e9fed071320502100;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git "a/c\316\273ash/CLasH/Normalize/NormalizeTypes.hs" "b/c\316\273ash/CLasH/Normalize/NormalizeTypes.hs" index 3affc87..9059252 100644 --- "a/c\316\273ash/CLasH/Normalize/NormalizeTypes.hs" +++ "b/c\316\273ash/CLasH/Normalize/NormalizeTypes.hs" @@ -14,5 +14,14 @@ import CLasH.Translator.TranslatorTypes -- over a single expression and track if the expression was changed. type TransformMonad = Writer.WriterT Monoid.Any TranslatorSession +-- | In what context does a core expression occur? +data CoreContext = AppFirst -- ^ The expression is the first + -- argument of an application (i.e., + -- it is applied) + | AppSecond -- ^ The expression is the second + -- argument of an application + -- (i.e., something is applied to it) + | Other -- ^ Another context + -- | Transforms a CoreExpr and keeps track if it has changed. -type Transform = CoreSyn.CoreExpr -> TransformMonad CoreSyn.CoreExpr +type Transform = [CoreContext] -> CoreSyn.CoreExpr -> TransformMonad CoreSyn.CoreExpr