@@ -244,6 +244,9 @@ buildDepMap ci ctx ns = addPostulates $ dfs S.empty M.empty ns
244 | otherwise
244 | otherwise
245 -> node n args -- depends on whether the referred thing uses its argument
245 -> node n args -- depends on whether the referred thing uses its argument
247+ -- TODO: could we somehow infer how bound variables use their arguments?
248+ V i -> M.unionWith S.union ((bs !! i) cd) (unconditionalDeps args)
247 -- we interpret applied lambdas as lets in order to reuse code here
250 -- we interpret applied lambdas as lets in order to reuse code here
248 Bind n (Lam ty) t -> getDepsTerm vs bs cd (lamToLet [] app)
251 Bind n (Lam ty) t -> getDepsTerm vs bs cd (lamToLet [] app)
@@ -261,6 +264,8 @@ buildDepMap ci ctx ns = addPostulates $ dfs S.empty M.empty ns
262 -> error $ "cannot analyse projection !" ++ show i ++ " of " ++ show t
265 -> error $ "cannot analyse projection !" ++ show i ++ " of " ++ show t
264 _ -> error $ "cannot analyse application of " ++ show fun ++ " to " ++ show args
269 _ -> error $ "cannot analyse application of " ++ show fun ++ " to " ++ show args
266 ins = M.insertWith S.union cd
271 ins = M.insertWith S.union cd