Pass the context in which an expression occurs to each transformation.
[matthijs/master-project/cλash.git] / cλash / CLasH / Normalize / NormalizeTypes.hs
index 3affc870d75d0f2fa8a9655a7d93a561fbfd7892..a7de6dced1645a69539b4d7c0ec39b916aeaea42 100644 (file)
@@ -14,5 +14,8 @@ 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 = 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