case checking partially working

This commit is contained in:
2024-08-04 15:46:43 -07:00
parent 067a83960d
commit 09227e444a
11 changed files with 174 additions and 33 deletions

View File

@@ -44,8 +44,12 @@ public export
addDef : TopContext -> String -> Tm -> Tm -> TopContext
addDef tc name tm ty = { defs $= go } tc
where
-- What did I do here?
go : List TopEntry -> List TopEntry
-- FIXME throw if we hit [] or is not an axiom
go [] = []
go ((MkEntry nm _ _) :: xs) = MkEntry nm ty (Fn tm) :: xs
-- FIXME use a map, I want updates
go [] = ?addDEF_fail
go (x@(MkEntry nm _ _) :: xs) = if nm == name
then MkEntry nm ty (Fn tm) :: xs
else x :: go xs