@@ -60,7 +60,6 @@ import Data.Semigroup
6060import Data.Maybe
6161import Data.List
6262
63-
6463-- | Do the static argument transformation on a whole program.
6564staticArgsPass :: (MonadNamey m , IsVar a ) => [Stmt a ] -> m [Stmt a ]
6665staticArgsPass = traverse staticArg_stmt
@@ -174,13 +173,13 @@ doStaticArgs the_func the_type the_body =
174173 mkShadow worker =
175174 let go_dynamic args = do
176175 inside <- mkApps (Ref worker worker_ty) worker_ty args
177- pure $ foldr Lam inside args
176+ refresh $ foldr Lam inside args
178177
179178 go (Static (TypeArgument _ k): xs) = do
180- x <- fromVar . mkTyvar <$> genName
179+ x <- fresh' TypeVar
181180 Lam (TypeArgument x k) <$> go xs
182181 go (Static (TermArgument _ k): xs) = do
183- x <- fromVar . mkVal <$> genName
182+ x <- fresh' ValueVar
184183 Lam (TermArgument x k) <$> go xs
185184 go [] = go_dynamic non_static_bndrs
186185 go _ = error " NonStatic binder in static_binders"
@@ -229,11 +228,11 @@ isStatic _ _ = NonStatic
229228mkApps :: forall a m . (IsVar a , MonadNamey m ) => Atom -> Type -> [Argument a ] -> m (Term a )
230229mkApps at _ [] = pure $ Atom at
231230mkApps at (ForallTy Irrelevant _ t) (TermArgument x tau: xs) = do
232- this_app <- fromVar . mkVal <$> genName
231+ this_app <- fresh' ValueVar
233232 Let (One (this_app, t, App at (Ref (toVar x) tau))) <$>
234233 mkApps (Ref (toVar this_app) t) t xs
235234mkApps at (ForallTy r _ t) (TypeArgument v _: xs) = do
236- this_app <- fromVar . mkVal <$> genName
235+ this_app <- fresh' ValueVar
237236 let t' =
238237 case r of
239238 Relevant binder -> substituteInType (VarMap. singleton binder (VarTy (toVar v))) t
0 commit comments