X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=blobdiff_plain;f=clash%2FCLasH%2FNormalize%2FNormalizeTypes.hs;h=07ccd977353603d990a46002c3eced2e6cd87ad6;hp=4e98709eed26c2bf07dbbf5339014957cd44910d;hb=82a01c9291c350ee8aeae80d62d6a45f7fb50940;hpb=a1b19f34a500caafbfc494ed101eb457ffc3262b diff --git a/clash/CLasH/Normalize/NormalizeTypes.hs b/clash/CLasH/Normalize/NormalizeTypes.hs index 4e98709..07ccd97 100644 --- a/clash/CLasH/Normalize/NormalizeTypes.hs +++ b/clash/CLasH/Normalize/NormalizeTypes.hs @@ -32,3 +32,22 @@ data CoreContext = AppFirst -- ^ The expression is the first deriving (Eq, Show) -- | Transforms a CoreExpr and keeps track if it has changed. type Transform = [CoreContext] -> CoreSyn.CoreExpr -> TransformMonad CoreSyn.CoreExpr + +-- Predicates for each of the context types +is_appfirst_ctx, is_appsecond_ctx, is_letbinding_ctx, is_letbody_ctx, is_lambdabody_ctx + :: CoreContext -> Bool + +is_appfirst_ctx AppFirst = True +is_appfirst_ctx _ = False + +is_appsecond_ctx AppSecond = True +is_appsecond_ctx _ = False + +is_letbinding_ctx LetBinding = True +is_letbinding_ctx _ = False + +is_letbody_ctx LetBody = True +is_letbody_ctx _ = False + +is_lambdabody_ctx LambdaBody = True +is_lambdabody_ctx _ = False