···3344- [ ] Use looping for TCO
55 - For single functions at least - I think this would be a performance win. I've learned that the slowness on `bun` goes away if I drop the TCO transform.
66+ - Doing this manually for `lookupT23` got 3% speedup.
67- [ ] Importing Prelude twice should be an error (currently it causes double hints and breaks auto)
77-- [ ] For errors in other files, point to the import
88+- [x] For errors in other files, point to the import
89- [x] Unsolved metas should be errors (user metas are fine)
910- [x] Better syntax for forward declared data (so we can distinguish from functions)
1011- [ ] maybe allow "Main" module name for any file
···1415- [x] Case split for LSP mode
1516- [x] Require lowercase pattern variables
1617 - I accidentally misspell a constructor and end up with a wildcard.
1717-- [ ] Leverage LSP code for web playground
1818+- [x] Leverage LSP code for web playground
1819- [ ] Improve handling of names:
1920 - We need FC on names in a lot of places
2021 - [x] FC for duplicate `data`, `record`, `class` name is wrong (points to `data`)
···4647 - Or the name on the VVar?
4748 - Also we should render %pi, etc more readably (bonus points for _×_)
4849- Editor support:
4949- - [ ] add missing cases should skip indented lines
5050- - [ ] add missing cases should handle `_::_`
5151- - [ ] add missing cases should share code between vscode and playground
5050+ - [x] add missing cases should skip indented lines
5151+ - [x] add missing cases should handle `_::_`
5252+ - [x] add missing cases should share code between vscode and playground
5253 - [x] "Not in scope" should offer to import
5353- - [ ] Case split
5454+ - [x] Case split
5455- [ ] Delay checking
5556 - We have things like `foldr (\ x acc => case x : ...`, where the lambda doesn't have a good type, so we have to be explicit. If we could defer the checking of that expression until more things are solved, we might not need the annotation (e.g. checking the other arguments). Some `case` statements may have a similar situation.
5657 - One idea is to throw the checks onto some sort of TODO list and run whatever works. (I think Idris may have a heuristic where it checks arguments backwards in some cases.)
5758- [x] Dependent records (I guess I missed that bit)
5858-- [ ] Arguments on records
5959+- [x] Arguments on records
5960- [ ] Add sugar for type aliases (maybe infer arguments)
6061 - Lean has this, we maybe could run infer on the RHS and call it a day? We would need a simple LHS, though.
6162- [ ] see if we can get a better error if `for` is used instead of `for_` in do blocks
···8990- [ ] Look into using holes for errors (https://types.pl/@AndrasKovacs/115401455046442009)
9091 - This would let us hit more cases in a function when we hit an error.
9192 - I've been wanting to try holes for parse errors too.
9393+ - Does softening up check errors break `auto`?
9294 - [ ] Missing `∀ k` in type is error -> no declaration for, if we insert a hole, we can get the declaration.
9395- [ ] in-scope type at point in vscode
9496 - So the idea here is that the references will be via FC, we remember the type at declaration and then point the usage back to the declaration (FC -> FC). We could dump all of this. (If we're still doing json.)
9597 - This information _could_ support renaming, too (but there may be indentation issues).
9698 - Do we want to (maybe later) keep the scope as a FC? We could do scope at point then.
9797- - But ideally we'd switch to a server/repl, so we don't have to mess around with serializing stuff.
9899- [ ] LSP and/or more editor support
99100 - [ ] refactor to query based? E.g. importing a module
100100- - [ ] would be nice to have "add missing cases" and "case split"
101101+ - [x] would be nice to have "add missing cases" and "case split"
101102 - [x] Probably need ranges for FC
102102- - [ ] leave an interactive process running
103103+ - [x] leave an interactive process running
103104 - [ ] restart mid file (we could save state per top level decl)
104105 - [ ] rename in editor (need to accumulate all names and what they reference)
105106 - [ ] who calls X? We can only do this scoped to the current context for now. Someday whole source dir. #lsp
106107- [ ] Pretty print
107108 - Can we format code? Maybe pull nearby comments or attach them like FC to tokens?
108109 - We would need to address stack and laziness issues in prettier printer (or make it merely pretty)
109109-- [ ] Look into descriptions, etc.
110110- - Can generating descriptions help with automatic "show" implementations
111111- - We lost debug printing when switching to numeric tags
112112- - Where did I see the idea of generating descriptions for inductive types?
113110- [ ] Add info to Ref/VRef (is dcon, arity, etc)
114111 - To save lookups during compilation and it might make eval faster
115112- [x] number tags for data constructors
···123120 - [ ] Maybe add qualified names to surface syntax and allow / detect conflicts on reference
124121 - [ ] Add `export` keywords
125122- [x] vscode - run newt when switching editors
126126-- [ ] case split
123123+- [x] case split
127124 - We could fake this up:
128125 - given a name and a point in the editor
129126 - walk through the function looking for the binder
···131128 - enumerate valid constructors (and their arity)
132129 - Repeat the line with each, applied to args
133130 - For `<-` or `let` we'd want to fudge some `|` lines
131131+ - [ ] `let` has issues for multiline split / add missing
132132+ - [ ] `derive` has phantom splits in it
134133- [x] Support "Add missing cases"
135134 - This has been hakced together
135135+ - LSP version now.
136136 - We could possibly fake up missing cases, too. Since they're listed and have an FC pointing at the first one
137137- [x] inline struct getters during code generation (We'd like `x.h1.h2`)
138138- [ ] Better FC for parse errors (both EOF and the ones that show up just after the error)
···149149 - [x] Maybe tag some functions as inline
150150 - [x] Eq Nat is not tail recursive because of the call to `==`
151151- [ ] Eq Nat does things the hard way, can we turn it into `==`?
152152+ - We could have a compile time substitution for the function
153153+ - Maybe this could reify how we're hard coding functions to js operators
152154- [x] use hint table for auto solving. (I think walking the `toList` is a big chunk of performance in `Elab.newt`.)
153155- [x] implement string enum (or number, but I'm using strings for tags at the moment)
154156- [x] use monaco input method instead of lean's
155157- [x] `Def` is shadowed between Types and Syntax (TCon vs DCon), detect this
156156-- [ ] constructor magic for Bool?
158158+- [x] constructor magic for Bool?
157159 - We'd have to make assumptions about order.
158160 - we could special case some translations
159161 - extra code.
···161163 - Two issues
162164 - I'm rewriting stuff in the context, leaving it in a bad state (forward references). I think I can avoid this.
163165 - The variables at the end of pattern matching have types with references in the wrong order. I think we can reorder them on dependencies.
164164- - should w
166166+ - In some cases Idris stuffs Erased into types.
165167- Improve `auto`
166168 - [ ] Improve cases where the auto isn't solved because of a type error
167169 - [ ] Handle `Foo Blah`, `Foo a => Bar a` vs `Bar Blah`
168170- [ ] Add some optimizations
169169- - [ ] see if we can make the typeclass stuff a little leaner, e.g. inline a projection of a static record.
171171+ - [ ] see if we can make the typeclass stuff a little leaner, e.g. inline a projection of a static record. (Maybe done now with the inlining, but verify.)
170172 - It would be nice if IO looked like imperative JS, but that might be a bit of a stretch.
171171-172172-173173- [ ] warn on unused imports?
174174 - Probably have to mark on name lookup, maybe wait until we have query-based
175175- [x] redo code to determine base path
···185185- [x] get port to run
186186 - [x] something goes terribly wrong with traverse_ and for_ (related to erasure, I think)
187187- [x] ~~don't use `take` - it's not stack safe~~ The newt version is stack safe
188188-- [ ] show user hole info even in case of error
188188+- [x] show user hole info even in case of error
189189- [x] tokenizer that can be ported to newt
190190- [ ] Add default path for library, so we don't need symlinks everywhere and can write tests for the library
191191 - We need this to work for tests / dev and for installed newt.
192192+ - The new `FileSource` mechanism might help here.
192193- [x] string interpolation?
193194 - The tricky part here is the `}` - I need to run the normal tokenizer in a way that treats `}` specially.
194195 - Idris handles `putStrLn "done \{ show $ add {x=1} 2}"` - it recurses for `{` `}` pairs. Do we want that complexity?
···202203- [x] record update sugar
203204- [x] Change `Ord` to be more like Idris - LT / EQ / GT (and entail equality)
204205- [ ] Consider making `<` independent of `Ord`, so we get the `<` oper in the javascript.
206206+ - Maybe a "default implementation" deal.
205207- [x] Keep a `compare` function on `SortedMap` (like lean)
206208 - `emptyMap` helper defaults to `compare` from `Ord a`
207209- [x] keymap for monaco
···258260 - Probably fixed by trying to solve auto immediately
259261- [x] Can't skip an auto. We need `{{_}}` to be auto or have a `%search` syntax.
260262- [x] add filenames to FC
261261-- [ ] Add full ranges to FC
263263+- [x] Add full ranges to FC
264264+ - [ ] Done, but we need to fix a bunch of FC in the parser
262265- [x] maybe use backtick for javascript so we don't highlight strings as JS
263266- [x] dead code elimination
264267- [x] imported files leak info messages everywhere