Commit Graph

763 Commits

Author SHA1 Message Date
Edwin Brady
f3cb5a8648 Delay record updates on type inference failure
Sometimes this'll need to be postponed since we need information from
elsewhere to know what the record type is (just like in ambiguity
resolution)
2020-02-01 12:57:45 +00:00
Edwin Brady
7d47c08140 Add Data.List.isPrefix 2020-02-01 12:57:14 +00:00
Edwin Brady
960ad42732 Add System.Info
Gets the OS info from the host compiler, which we'll need to be careful
with when bootstrapping (since maybe we'll distribute generated chez or
racket as a starting point for bootstrapping...)
2020-02-01 12:32:42 +00:00
Edwin Brady
4fed357fb4 Allow type annotations on lets
Fixes #87
2020-02-01 12:17:54 +00:00
Edwin Brady
284a3ded69 Add strIndex and strTail 2020-01-31 23:06:08 +00:00
Edwin Brady
886b6aae7f Reset auto lazy/unbound implicits
These options are local to a file, so reset when building a module. Also
actually enable the %auto_lazy directive.
2020-01-31 18:23:38 +00:00
Christian Rasmussen
3a436061ca Fix IDE Mode for Atom 2020-01-31 19:21:42 +01:00
Edwin Brady
b1c37b00ca Support hex literals in the parser 2020-01-31 18:15:19 +00:00
Edwin Brady
2465e5a149 Some buffer updates
Initialising buffers from files, error checking on creation, resizing.
2020-01-31 16:49:31 +00:00
Edwin Brady
e69c1529d9 Bitwise operators 2020-01-31 16:25:19 +00:00
Edwin Brady
854e39936e Some Data.Buffer bits
Need to know length of strings in bytes sometimes, not just characters,
to check we have enough space.
Also add copyData
2020-01-30 18:36:59 +00:00
Edwin Brady
0cb446dd31 Only use version tag in display
Not in generating install directories, otherwise we end up with loads of
new directories for every patch and the purpose is to make it easy to
see which version you're working with.
2020-01-30 18:25:18 +00:00
Edwin Brady
bb6cefc0a9 Added Data.IOArray
plus scheme primitives for runtime, via vectors
2020-01-30 17:04:33 +00:00
Edwin Brady
802dee2192 Fix ! notation on ifs
It wasn't lifting out things in the expression to be tested (via
desugarB).
2020-01-30 14:38:28 +00:00
Edwin Brady
56b01f476b Temporarily disable a couple of unused things
The Chicken backend and reflection code are currently unused, and add to
memory usage and build time, so best leave them out for the moment.

They will be back! But probably best to wait until we can self host -
which hopefully won't be long - and we can take advantage of some of
the things Idris 2 does to compile quicker and using less space!
2020-01-27 19:17:02 +00:00
Edwin Brady
6f9cca6ce3 Change inference of function types in unification
Always infer a multiplicity of W. Since we can pass a linear function to
one which expects an unrestricted argument, this gives the more general
result if the multiplicity is otherwise unknown.
This makes things like 'maybe id (+) x y' type check again even in the
presence of an 'id' which is declared linear!
2020-01-27 17:54:21 +00:00
Edwin Brady
c725d37488 Add %unbound_implicits directive
This is the same as %auto_implicits in Idris 1, but with a more
appropriate name, because auto implicits are something else.
'%unbound_implicits off' turns off implicit forall bindings. See test
basic033 for an example.
2020-01-27 17:31:53 +00:00
Edwin Brady
3cb574102a Add idiom brackets 2020-01-26 17:24:25 +00:00
Edwin Brady
1da3af5b2a Add ! notation
In a small change from Idris 1, this lifts to the nearest binder or
block, so doesn't lift past an explicit "do" in particular. Blocks are:
- case branches
- if branches
- scope of local function definitions, or any binder
- do blocks
2020-01-26 16:52:25 +00:00
Edwin Brady
9cd040fcb4 Resolving ambiguity under IMustUnify
Need to use 'check' which expands ambiguous names, rather than
'checkImp' which does nothing. It won't insert any new dots since it
checks in expression context.
2020-01-25 13:23:56 +00:00
Edwin Brady
a26581f454 Use a data type for dotting reason
Then we can more safely match on it
2020-01-24 16:16:31 +00:00
Edwin Brady
118ea787c3 Add syntax for 'using' blocks 2020-01-24 15:21:16 +00:00
Edwin Brady
c84e2b5cb7 void's argument is certainly irrelevant!
Since it's the empty type...
2020-01-23 17:45:19 +00:00
Edwin Brady
04e4ebf80e Better approach to erasure in pattern matching
It's a big patch, but the summary is that it's okay to use a pattern in
an erased position if either:

- the pattern can also be solved by unification (this is the same as
  'dot patterns' for matching on non-constructor forms)
- the argument position is detaggable w.r.t. non-erased arguments, which
  means we can tell which pattern it is without pattern matching

The second case, in particular, means we can still pattern match on
proof terms which turn out to be irrelevant, especially Refl.

Fixes #178
2020-01-21 18:47:43 +00:00
Edwin Brady
6dd9c1296f Remove duplicate error display 2020-01-19 20:35:48 +00:00
Edwin Brady
641be8b1e6 Merge branch 'master' of github.com:edwinb/Idris2 2020-01-19 16:59:34 +00:00
Edwin Brady
5fa2e19632 Merge branch 'ohad-linearity-clean' 2020-01-19 16:56:30 +00:00
Edwin Brady
af9e920d74 Merge branch 'linearity-clean' of https://github.com/ohad/Idris2 into ohad-linearity-clean 2020-01-19 16:56:13 +00:00
Edwin Brady
9d0e2d8522
Merge pull request #182 from andrevidela/syntax-compiler-inline
Tidying up Inline.idr for streaming
2020-01-19 16:53:06 +00:00
Edwin Brady
16dd76e580
Merge pull request #172 from MilanKral/https
Use HTTPS instead of HTTP
2020-01-19 16:50:41 +00:00
Edwin Brady
ea8c22135c
Merge pull request #156 from clayrat/misc-fixes
Misc fixes and additions
2020-01-19 16:48:47 +00:00
Edwin Brady
a275b57a81
Merge pull request #154 from abailly/better-ide-mode
Improve IDE mode to provide basic Emacs mode interaction
2020-01-19 16:47:18 +00:00
Edwin Brady
02e716dfe8
Merge pull request #180 from ohad/contrib
Create a contrib directory in the standard library
2020-01-19 16:45:00 +00:00
Edwin Brady
692bd8a547 Generated names need to be unique in clauses
Otherwise we might think we've dealt with an erased name when we haven't
- given that clauses are compiled all together.
Fixes #186
2020-01-19 16:36:30 +00:00
Edwin Brady
f81085cf67 Normalise goal on initialising proof search
It needs normalising anyway to get for determining arguments, so might
as well do it up front (it can save time later).
2020-01-18 23:37:20 +00:00
Edwin Brady
b8a8f0ef1b Some fixes in time logging code 2020-01-18 15:14:23 +00:00
Edwin Brady
7e54065e00 Remove need for renameVars in unification
I don't know why I didn't do it this way in the first place... it's only
a small improvement, but saves a traversal of a potentiall big term.
2020-01-16 16:26:26 +00:00
Alex Gryzlov
ce15b48a78 Merge remote-tracking branch 'upstream/master' into misc-fixes 2020-01-15 22:52:38 +01:00
Edwin Brady
6495d603d7 Add %unifyLog for debugging
Prints debugging logs while elaborating the argument
2020-01-15 09:49:41 +00:00
Edwin Brady
d619c09ba3 Remove unnecessary solveConstraints 2020-01-13 11:49:16 +00:00
Edwin Brady
fe74d6bb7c Add impossibility flag to Erased
This is to help coverage checking, for LHS clauses which are impossible,
so that we can build the complete case tree from the impossible clauses
too.
2020-01-12 20:06:02 +00:00
Edwin Brady
751fd1f36a Experiment with hole name display
If unelaborating a term that's just a hole, show the scope it was
created in too, to help with error messages
2020-01-11 23:34:44 +00:00
Edwin Brady
62a86db1d5 Fix build! 2020-01-11 23:08:30 +00:00
Edwin Brady
4ce469cc03 Name choice of holes
The names should give more of a hint as to where the holes were created.
Might help with #161.
2020-01-11 22:52:18 +00:00
Edwin Brady
abd801c45a
Merge pull request #177 from SPY/testfix/chez010-macos
Fix chez010 test on MacOS
2020-01-11 22:50:16 +00:00
Edwin Brady
da293d1ce8 Check constructors are fully applied in case trees
This is necessary to build case trees correctly, and without this, we
can get mysterious and hard to debug run time errors!
2020-01-11 17:27:27 +00:00
Arnaud Bailly
432cc7ca5c Merge branch 'master' of https://github.com/edwinb/Idris2 into better-ide-mode 2020-01-11 09:45:39 +01:00
André Videla
a145ba99d7 Cosmetic changes in src/Compiler/Inline
Refactor LengthMatch into its own file
2020-01-10 18:26:32 +00:00
Ilya Rezvov
32b1c9b34f use an explicit extension for libcb references in %foreign pragmas 2020-01-09 11:55:33 -08:00
Ilya Rezvov
56d24e34d4 Merge remote-tracking branch 'origin/master' into testfix/chez010-macos 2020-01-09 11:44:51 -08:00