checkpoint before FC

This commit is contained in:
2024-08-05 21:25:10 -07:00
parent 09227e444a
commit f5b1998afb
4 changed files with 10 additions and 3 deletions

View File

@@ -15,7 +15,9 @@ plus = \ n m => case n of
Z => m Z => m
S k => S (plus k m) S k => S (plus k m)
-- So this isn't working at the moment, I think I need
-- to replace the n with S ?k
length : {a : U} {n : Nat} -> Vect n a -> Nat length : {a : U} {n : Nat} -> Vect n a -> Nat
length = \ v => case v of length = \ v => case v of
Nil => Z Nil => Z
Cons x xs => S (length {a} xs) Cons {a} {n'} x xs => S (length {a} xs)

View File

@@ -210,6 +210,11 @@ checkAlt scty ctx ty (MkAlt ptm body) = do
let var = VVar (length ctx.env) [<] let var = VVar (length ctx.env) [<]
let ctx' = extend ctx nm a let ctx' = extend ctx nm a
Lam nm <$> go !(b $$ var) t ctx' Lam nm <$> go !(b $$ var) t ctx'
go (VPi str Implicit a b) (RApp t (RSrcPos _ (RVar nm)) Implicit) ctx = do
debug "*** \{nm} : \{show a}"
let var = VVar (length ctx.env) [<]
let ctx' = extend ctx nm a
Lam nm <$> go !(b $$ var) t ctx'
go (VPi str Implicit a b) t ctx = do go (VPi str Implicit a b) t ctx = do
let var = VVar (length ctx.env) [<] let var = VVar (length ctx.env) [<]
let ctx' = extend ctx "_" a let ctx' = extend ctx "_" a

View File

@@ -131,7 +131,7 @@ Show Raw where
show (RCase x xs) = foo [ "Case", show x, show xs] show (RCase x xs) = foo [ "Case", show x, show xs]
show (RParseError str) = foo [ "ParseError", "str"] show (RParseError str) = foo [ "ParseError", "str"]
show RU = "U" show RU = "U"
show (RSrcPos pos tm) = show tm show (RSrcPos pos tm) = foo [ "#", show tm]
export export

View File

@@ -20,7 +20,7 @@ opChar : Lexer
opChar = pred isOpChar opChar = pred isOpChar
identMore : Lexer identMore : Lexer
identMore = alphaNum <|> exact "." identMore = alphaNum <|> exact "." <|> exact "'"
rawTokens : Tokenizer (Token Kind) rawTokens : Tokenizer (Token Kind)
rawTokens rawTokens