X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FNormalize%2FNormalizeTypes.hs;h=80d39ac19ce10dbfccb75af33057a49e24f0c9a1;hb=bcaa7ec85a9025a95c431f550bb5ea0cf5af5375;hp=a7de6dced1645a69539b4d7c0ec39b916aeaea42;hpb=3deb1d21f696f8495cd99345c9677210e2a2fc79;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 a7de6dc..80d39ac 100644 --- "a/c\316\273ash/CLasH/Normalize/NormalizeTypes.hs" +++ "b/c\316\273ash/CLasH/Normalize/NormalizeTypes.hs" @@ -15,7 +15,19 @@ import CLasH.Translator.TranslatorTypes type TransformMonad = Writer.WriterT Monoid.Any TranslatorSession -- | In what context does a core expression occur? -data CoreContext = Other -- ^ Another context - +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) + | LetBinding -- ^ The expression is bound in a + -- (recursive or non-recursive) let + -- expression. + | LetBody -- ^ The expression is the body of a + -- let expression + | LambdaBody -- ^ The expression is the body of a + -- lambda abstraction + | Other -- ^ Another context -- | Transforms a CoreExpr and keeps track if it has changed. type Transform = [CoreContext] -> CoreSyn.CoreExpr -> TransformMonad CoreSyn.CoreExpr