Newt in Newt compiles (but does not run)

This commit is contained in:
2025-01-04 09:26:33 -08:00
parent 46434cc555
commit 6b1eef86a7
21 changed files with 2970 additions and 91 deletions

View File

@@ -11,16 +11,16 @@ funArgs tm = go tm Nil
go t args = (t, args)
data Binder : U where
MkBind : FC -> String -> Icit -> Quant -> Tm -> Binder
MkBinder : FC -> String -> Icit -> Quant -> Tm -> Binder
-- I don't have a show for terms without a name list
instance Show Binder where
show (MkBind _ nm icit quant t) = "(\{show quant}\{nm} \{show icit} : ... :: Nil)"
show (MkBinder _ nm icit quant t) = "(\{show quant}\{nm} \{show icit} : ... :: Nil)"
splitTele : Tm -> (Tm × List Binder)
splitTele = go Nil
where
go : List Binder -> Tm -> (Tm × List Binder)
go ts (Pi fc nm icit quant t u) = go (MkBind fc nm icit quant t :: ts) u
go ts (Pi fc nm icit quant t u) = go (MkBinder fc nm icit quant t :: ts) u
go ts tm = (tm, reverse ts)