nf the types, block comments, more eq example now that we have implicits
This commit is contained in:
@@ -42,10 +42,12 @@ Questions:
|
|||||||
- [ ] Should I write this up properly?
|
- [ ] Should I write this up properly?
|
||||||
|
|
||||||
Parser:
|
Parser:
|
||||||
- [ ] parser for block comments
|
- [x] parser for block comments
|
||||||
- [x] import statement
|
- [x] import statement
|
||||||
- [x] def
|
- [x] def
|
||||||
- [x] simple decl
|
- [x] simple decl
|
||||||
|
- [ ] check (either check at _ or infer and let it throw)
|
||||||
|
- [ ] nf (ditto, but print value. WHNF for now )
|
||||||
|
|
||||||
Misc:
|
Misc:
|
||||||
- [x] vscode support for .newt
|
- [x] vscode support for .newt
|
||||||
@@ -65,10 +67,10 @@ Misc:
|
|||||||
- [x] figure out context representation - Global context?
|
- [x] figure out context representation - Global context?
|
||||||
- [x] type checking / elab
|
- [x] type checking / elab
|
||||||
- What does this represent? The basics, implicits? pattern unification?
|
- What does this represent? The basics, implicits? pattern unification?
|
||||||
- [ ] symbolic execution
|
- [ ] check for unsolved metas (after each def or at end?)
|
||||||
- why did I put this here? Is it just for `eval`? We do have CBN in place, we could eval inferrable
|
|
||||||
- [ ] compilation
|
- [ ] compilation
|
||||||
- I'm thinking I get data working first
|
- I'm thinking I get data working first
|
||||||
|
- [ ] repl
|
||||||
- [ ] write tests
|
- [ ] write tests
|
||||||
- [ ] Split up code better
|
- [ ] Split up code better
|
||||||
|
|
||||||
@@ -77,6 +79,7 @@ Forward:
|
|||||||
- [ ] Switch to query-based?
|
- [ ] Switch to query-based?
|
||||||
- [ ] LSP?
|
- [ ] LSP?
|
||||||
- [ ] white box testing
|
- [ ] white box testing
|
||||||
|
- [ ] switches on logging
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|||||||
17
newt/eq.newt
17
newt/eq.newt
@@ -6,10 +6,17 @@ Eq : {A : U} -> A -> A -> U
|
|||||||
Eq = \ {A} => \ x => \ y => (P : A -> U) -> P x -> P y
|
Eq = \ {A} => \ x => \ y => (P : A -> U) -> P x -> P y
|
||||||
|
|
||||||
refl : {A : U} {x : A} -> Eq x x
|
refl : {A : U} {x : A} -> Eq x x
|
||||||
refl = \ {A} => \ {x} => x
|
refl = \ P Px => Px
|
||||||
|
|
||||||
|
id : {A} -> A -> A
|
||||||
|
id = \ x => x
|
||||||
|
|
||||||
|
coerce : {A B : U} -> Eq A B -> A -> B
|
||||||
|
-- coerce refl a = a
|
||||||
|
coerce = \ EqAB a => EqAB id a
|
||||||
|
|
||||||
-- can I write J without pattern matching?
|
-- can I write J without pattern matching?
|
||||||
J : {A : U} {x y : A} (eq : Eq x y) ->
|
-- J : {A : U} {x y : A} (eq : Eq x y) ->
|
||||||
(mot : (x : A) (P : Eq x y) -> U)
|
-- (mot : (x : A) (P : Eq x y) -> U)
|
||||||
(b : mot y refl) ->
|
-- (b : mot y refl) ->
|
||||||
mot x eq
|
-- mot x eq
|
||||||
|
|||||||
@@ -23,4 +23,4 @@ compile l (App t u) = compile l t <+> "(" <+> compile l u <+> ")"
|
|||||||
|
|
||||||
compile l U = "undefined"
|
compile l U = "undefined"
|
||||||
compile l (Pi str icit t u) = "undefined"
|
compile l (Pi str icit t u) = "undefined"
|
||||||
compile l (Meta k) = ?fixme_zonk
|
compile l (Meta k) = text "ZONKME \{show k}"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ rawTokens
|
|||||||
<|> match (some digit) (Tok Number)
|
<|> match (some digit) (Tok Number)
|
||||||
<|> match (is '#' <+> many alpha) (Tok Pragma)
|
<|> match (is '#' <+> many alpha) (Tok Pragma)
|
||||||
<|> match (lineComment (exact "--")) (Tok Space)
|
<|> match (lineComment (exact "--")) (Tok Space)
|
||||||
|
<|> match (blockComment (exact "/-") (exact "-/")) (Tok Space)
|
||||||
<|> match (some opChar) (\s => Tok Oper s)
|
<|> match (some opChar) (\s => Tok Oper s)
|
||||||
<|> match symbol (Tok Symbol)
|
<|> match symbol (Tok Symbol)
|
||||||
<|> match spaces (Tok Space)
|
<|> match spaces (Tok Space)
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ processDecl (TypeSig nm tm) = do
|
|||||||
putStrLn "-----"
|
putStrLn "-----"
|
||||||
putStrLn "TypeSig \{nm} \{show tm}"
|
putStrLn "TypeSig \{nm} \{show tm}"
|
||||||
ty <- check (mkCtx top.metas) tm VU
|
ty <- check (mkCtx top.metas) tm VU
|
||||||
putStrLn "got \{show ty}"
|
ty' <- nf [] ty
|
||||||
modify $ claim nm ty
|
putStrLn "got \{show ty'}"
|
||||||
|
modify $ claim nm ty'
|
||||||
|
|
||||||
-- FIXME - this should be in another file
|
-- FIXME - this should be in another file
|
||||||
processDecl (Def nm raw) = do
|
processDecl (Def nm raw) = do
|
||||||
|
|||||||
Reference in New Issue
Block a user