Commit Graph

852 Commits

Author SHA1 Message Date
Marshall Bowers
b0204accd3 Move :set and :unset to the command table 2020-03-27 23:44:38 -04:00
Marshall Bowers
48a7949d4d Add help text for :search and :di 2020-03-27 23:43:04 -04:00
Marshall Bowers
a5fa2e00e6 Reorder commands to the way they were prior to changes 2020-03-27 23:29:54 -04:00
Marshall Bowers
476e776083 Account for the various ways to parse commands 2020-03-27 23:28:32 -04:00
Marshall Bowers
abdad354dc Format the help command 2020-03-27 22:27:36 -04:00
Marshall Bowers
0371d5b0d1 Move :exec to the command table 2020-03-26 22:35:27 -04:00
Marshall Bowers
9701a178b5 Use the same command table for both parsing and help 2020-03-26 22:17:15 -04:00
Marshall Bowers
290db90025 Add ability to display the help 2020-03-26 00:30:25 -04:00
Marshall Bowers
cca6b06a05 Recognize the help commands 2020-03-25 22:17:40 -04:00
Edwin Brady
bba4b347b9 Don't evaluate under Delay in conversion check
At least, not under LInf. Otherwise we might try to build an infinite
structure, which won't end well. Or, indeed, at all.
2020-03-22 23:20:57 +00:00
Edwin Brady
14de988701 Add missing laziness coercion
We weren't adding laziness coercions when unification failed after a
retry, so sometimes they were getting dropped.
2020-03-22 20:32:18 +00:00
Edwin Brady
2b6bd74286 Small improvements in codegen performance
Lots of time is taken in finding the definitions to compile, mostly
because the definition itself needs to be decoded from the binary format
in the ttc, but we can at least make the rest of the process fast.

Inlining takes a while - we could improve this later by inlining as we
go, per file, rather than doing it just before compilation.
2020-03-21 22:51:20 +00:00
Edwin Brady
b310e28fdf Fix for resolved names
When we're checking if a definition is a hole and needs updating, when
loading ttc, the names might not fully resolved yet, so don't decode the
definition.
2020-03-21 14:27:03 +00:00
Edwin Brady
aaf6868bc7 Nested names need a unique index
We could have the same local name twice in the same parent function, in
different clauses.
2020-03-20 15:47:43 +00:00
Edwin Brady
49510bf164 Need to check multiplicity of names in LinearCheck
This is done during elaboration, but not for things which are solved by
unification or search, and they might be 0 if, say, they're a record
projection or other type level function.
2020-03-20 13:44:17 +00:00
Edwin Brady
b94c31a442 Faster generation of Scheme
fastAppend allocates the whole string at once, rather than concatenating
and therefore reallocating a lot
2020-03-20 13:43:26 +00:00
Edwin Brady
7dcb1cfd34 Metavar solutions might contain 'let'
Mostly if they arise from search, where the target of the search has a
let in the type. So, we need to consider this when checking
metavariables in the linearity check.
2020-03-19 22:14:57 +00:00
Edwin Brady
d666ed50c9 A couple of library functions 2020-03-19 22:14:48 +00:00
Edwin Brady
727d6e8ec5 Quicker building of dependency tree
The old way did a lot of needless traversal, though you wouldn't
typically notice until you start having 40+ modules to build. Now make a
note of what we've looked at already.
2020-03-19 18:51:16 +00:00
Edwin Brady
cbf8785d32 Take account of env in record elaboration
Also need to make sure that the constructor and fields are included in
the nested names so that the parameters get expanded properly.
Fixes #138
2020-03-19 12:12:25 +00:00
Edwin Brady
344a565a49 Comment consistency with code! 2020-03-18 23:10:14 +00:00
Edwin Brady
3cf223b835 Elaborate record bodies on second mutual pass
This is the same behaviour as Idris 1. Fixes #217
2020-03-18 23:09:17 +00:00
Edwin Brady
588a5b74cd Only record fields should be in a new namespace
Record name and constructor are in the outer namespace, fields in the
nested namepsace. Private names in the nested namespace is visible from
the outer namespace. Fixes #183

Also remove the 'nested' flag on INamespace, since it was only there for
records, and not really the right way to do things. The nested namespace
name is now given in the IRecord constructor (a front end might not want
to use a new namespace after all).
2020-03-18 22:48:19 +00:00
Edwin Brady
db7f500665
Merge pull request #234 from diakopter/patch-4
gitignore .so files under tests
2020-03-18 20:38:46 +00:00
Edwin Brady
3a2abe2e45
Merge pull request #231 from andrevidela/ttc-debug
Add version and file to TTCError
2020-03-18 20:38:07 +00:00
Edwin Brady
776abebba1
Merge pull request #227 from ska80/typedd-book/chapter13-14
Port code examples for chapters 13 and 14 from TypeDD book
2020-03-18 20:37:26 +00:00
Edwin Brady
dd7ed89ed0
Merge pull request #222 from ziman/sorted-map-set
Adapt Data.Sorted{Map,Set} from Idris 1
2020-03-18 20:35:33 +00:00
Edwin Brady
6f933ba230
Merge pull request #221 from ziman/parser-lazy
Make the applicative combinators in `Text.Parser.Core` lazier
2020-03-18 20:35:01 +00:00
Edwin Brady
8b6527867a
Merge pull request #220 from ziman/lexer-parser-core
Add Text.{Lexer,Parser}.Core to the list of installed modules
2020-03-18 20:34:30 +00:00
Edwin Brady
745c3a4f29
Merge pull request #219 from diakopter/patch-3
various copyedits
2020-03-18 20:34:15 +00:00
Edwin Brady
c1bc4330fa Don't build run time case trees for Rig0 defs
They might match on runtime-erased things (which is okay, since they're
erased too!) and if we try building the tree, it'll report an error
incorrectly. Fixes #229
2020-03-18 20:09:11 +00:00
Edwin Brady
59b66d6134 Add prettyName
This is to display names in a user friendly way, especially case and
with block names
2020-03-18 19:33:19 +00:00
Edwin Brady
fbff80545d Add coverage006 test 2020-03-18 14:39:59 +00:00
Edwin Brady
22febdf7ff Take environment into account in coverage check
We weren't using the surrounding environment for building the patterns
for an impossible case, so getting strange errors. Fixes #228
2020-03-18 14:05:01 +00:00
Edwin Brady
1f0212c20d Update test output 2020-03-17 21:55:34 +00:00
Edwin Brady
8db29f5b35 Add --no-banner to test 2020-03-17 21:34:16 +00:00
Edwin Brady
102fb7fdb6 Coverage checker improvement
Check that none of the generated missing cases match explicitly given
clauses, which might happen if there's some overlaps in the clauses or
if there's some matching on implicits. Ignore erased argument positions
when checking the match.
2020-03-17 21:12:21 +00:00
Matthew Wilson
2c70f2b744
gitignore .so files under tests 2020-03-17 01:29:21 -04:00
André Videla
b69af3a868 Add version and file to TTCError 2020-03-13 21:43:04 +00:00
Kamil Shakirov
1704495f06 Port code examples for chapters 13 and 14 from TypeDD book 2020-03-13 09:50:22 +06:00
Edwin Brady
946881d56c Make sure we only insert 'Delay' at the top level
If we postpone unification problems, it's not necessarily at the top
level of a term, but then if we retry and find we need to insert a
'Delay' or 'Force' then it had better be at the top level or we'll get
an incorrect term. So, keep track of this in postponed constraints.
2020-03-12 14:58:06 +00:00
Edwin Brady
20686425de Use expected type on adding laziness annotations
This will be the correct one, since the annotations get us to the
expected type.
2020-03-12 11:13:50 +00:00
Edwin Brady
fc9863b275 Fix Nat optimisation hack
I dont know how I thought that was supposed to work, but it needs to get
the S and Z cases separately then build the 'if' expression, with the
default case if either are missing.
2020-03-11 17:54:38 +00:00
Edwin Brady
cd57190f44 Erase LHS before case tree compilation
I had thought this was unnecessary, because it treats erased patterns as
variables, but it turns out we do need to erase variables where they're
sometimes used in erased positions, and sometimes not, to ensure we use
the right one.
2020-03-11 16:40:32 +00:00
Edwin Brady
7c8651a70c Don't keep appending directives
This could get really big given that there'll be lots of repetition in a
bigger project, and causes a segfault due to a stack overflow.
2020-03-11 10:20:27 +00:00
Edwin Brady
8507ccbeb7 Don't use force/delay in generated scheme
It's a bit more expensive than just using a lambda, because they cache
the result in a thread safe way, and the Idris Force/Delay doesn't
promise to cache the result anywya.
2020-03-11 10:10:11 +00:00
Edwin Brady
b52a10356c Fix ! notation in lists 2020-03-11 10:09:58 +00:00
Edwin Brady
9229cdbf1f Fix order of metavariable substitution
Need to substitute the one applied to most things, or it won't want to
substitute at all. Fixes #226
2020-03-10 19:39:36 +00:00
Edwin Brady
e342fce41e Detaggability under where clauses
Need to make sure we've got the right real name for the function - this
had previously only been tested in parameters blocks where the name
doesn't change.
2020-03-10 17:07:54 +00:00
Edwin Brady
b5b9372fff Add delete and union to Data.List 2020-03-10 14:52:46 +00:00