diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2025-11-22 22:41:09 +0100 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2025-11-22 22:41:09 +0100 |
| commit | 9b7c3eea7e34f5eb0d91f93b803e853028c2cec8 (patch) | |
| tree | 25b906bb49218d2743631d0c83e23717012e3b9b /src/CHAD/AST/Count.hs | |
| parent | b4f07c673b7c710f5861bb84e67233c63336c53d (diff) | |
WIP: Think about fusionfusion
Diffstat (limited to 'src/CHAD/AST/Count.hs')
| -rw-r--r-- | src/CHAD/AST/Count.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/CHAD/AST/Count.hs b/src/CHAD/AST/Count.hs index 46173d2..1dad758 100644 --- a/src/CHAD/AST/Count.hs +++ b/src/CHAD/AST/Count.hs @@ -338,15 +338,15 @@ envMaskPrj (EMRest b) _ = b envMaskPrj (_ `EMPush` b) IZ = b envMaskPrj (env `EMPush` _) (IS i) = envMaskPrj env i -occCount :: Idx env a -> Expr x env t -> Occ +occCount :: Idx env a -> Expr NoExt x env t -> Occ occCount idx ex | Some env <- occCountAll ex = fst (occEnvPrj env idx) -occCountAll :: Expr x env t -> Some (OccEnv Occ env) +occCountAll :: Expr NoExt x env t -> Some (OccEnv Occ env) occCountAll ex = occCountX SsFull ex $ \env _ -> Some env -pruneExpr :: SList f env -> Expr x env t -> Ex env t +pruneExpr :: SList f env -> Expr NoExt x env t -> Ex env t pruneExpr env ex = occCountX SsFull ex $ \_ mkex -> mkex (fullOccEnv env) where fullOccEnv :: SList f env -> OccEnv () env env @@ -365,7 +365,7 @@ pruneExpr env ex = occCountX SsFull ex $ \_ mkex -> mkex (fullOccEnv env) -- occurrence counts. The callback reconstructs a new expression in an -- updated "response" environment. The response must be at least as large as -- the computed usages. -occCountX :: forall env t t' x r. Substruc t t' -> Expr x env t +occCountX :: forall env t t' x r. Substruc t t' -> Expr NoExt x env t -> (forall env'. OccEnv Occ env env' -- response OccEnv must be at least as large as the OccEnv returned above -> (forall env''. OccEnv () env env'' -> Ex env'' t') @@ -885,7 +885,7 @@ occCountX initialS topexpr k = case topexpr of handleReduction :: t ~ TArr n (TScal t2) => (forall env2. Ex env2 (TArr (S n) (TScal t2)) -> Ex env2 (TArr n (TScal t2))) - -> Expr x env (TArr (S n) (TScal t2)) + -> Expr NoExt x env (TArr (S n) (TScal t2)) -> r handleReduction reduce e | STArr (SS n) _ <- typeOf e = @@ -914,7 +914,7 @@ deleteUnused (_ `SCons` env) (Some (OccPush occenv (Occ _ count) _)) k = case count of Zero -> k (SENo sub) _ -> k (SEYesR sub) -unsafeWeakenWithSubenv :: Subenv env env' -> Expr x env t -> Expr x env' t +unsafeWeakenWithSubenv :: Subenv env env' -> Expr NoExt x env t -> Expr NoExt x env' t unsafeWeakenWithSubenv = \sub -> subst (\x t i -> case sinkViaSubenv i sub of Just i' -> EVar x t i' |
