misc cleanup

This commit is contained in:
2024-10-30 21:22:45 -07:00
parent e6502abeed
commit 56e005d2dc
6 changed files with 18 additions and 31 deletions

View File

@@ -152,15 +152,21 @@ processDecl (Def fc nm clauses) = do
let mlen = length mc.metas `minus` mstart
solveAutos mlen (take mlen mc.metas)
-- Expand metas
-- tm' <- nf [] tm -- TODO - nf that expands all metas, Day1.newt is a test case
tm' <- zonk top 0 [] tm
putStrLn "NF \{pprint[] tm'}"
mc <- readIORef top.metas
for_ (take mlen mc.metas) $ \case
(Solved k x) => pure ()
(Unsolved (l,c) k ctx ty User cons) => do
-- TODO print here instead of during Elab
pure ()
(Unsolved fc k ctx ty User cons) => do
ty' <- quote ctx.lvl ty
let names = (toList $ map fst ctx.types)
-- I want to know which ones are defines. I should skip the `=` bit if they match, I'll need indices in here too.
env <- for (zip ctx.env (toList ctx.types)) $ \(v, n, ty) => pure " \{n} : \{pprint names !(quote ctx.lvl ty)} = \{pprint names !(quote ctx.lvl v)}"
let msg = "\{unlines (toList $ reverse env)} -----------\n goal \{pprint names ty'}"
info fc "User Hole\n\{msg}"
(Unsolved (l,c) k ctx ty kind cons) => do
tm <- quote ctx.lvl !(forceMeta ty)
-- Now that we're collecting errors, maybe we simply check at the end