Commit Graph

384 Commits

Author SHA1 Message Date
Fabián Heredia Montiel
757f41fbbe [test] Add preformance test of Fin/Vect
Closes idris-lang/Idris2#16
2021-06-14 17:28:58 +01:00
claymager
b946ec0277
[ fix ] Create library dir if necessary (#1300) 2021-06-14 16:12:46 +01:00
Edwin Brady
97ee3d4cd3 Check LHS arguments are polymorphic enough
We already did this, but missed a few cases due to the way arguments are
elaborated. So now, when checking an LHS, we don't allow LHS argument
types to be inferred from the pattern, but rather they must be inferred
from elsewhere. To do this, we keep track of the constraints which would
be solved when inferring the type, and make sure they don't solve any
new metavariables. Fixes #1510, and also now gets the error location
right as a bonus!
2021-06-13 13:31:40 +01:00
Edwin Brady
19cb2681be Only fully normalise fromInteger on LHS
This reduces surprising undefined name errors on the RHS, as noted in
issue #1541
2021-06-12 14:23:25 +01:00
Edwin Brady
06f69ba177 Fix test output
Because it relies on the source file that I've just fixed for the
linter. I think I've now spent more time pleasing the linter than fixing
the actual bug...
2021-06-11 13:02:38 +01:00
Edwin Brady
f923c3677d Please the linter again 2021-06-11 12:46:08 +01:00
Edwin Brady
38bdbfba84 Please the linter
I still don't think it should be looking in test sources. One day I'll
fix this.
2021-06-11 12:43:34 +01:00
Edwin Brady
663a8381f4 Properly normalise constants on LHS
We need to fully evaluate, not just the public export names, otherwise
we don't pattern match properly and potentially generate catch all
patterns we don't mean.

Fixes #1537
2021-06-11 12:37:45 +01:00
Edwin Brady
a75887ffa6 Update error018 test output 2021-06-10 12:42:54 +01:00
Edwin Brady
18c7e2c4da Merge github.com:idris-lang/Idris2 into normalise-tweaks 2021-06-10 12:22:02 +01:00
Edwin Brady
7d235272e3 Remove redundant converstion checks in Pi types
We've already checked argument and scope types, so only need to check
mulitplicities. This saves a lot of repetition when checking lambdas.
2021-06-10 12:19:41 +01:00
CodingCellist
abd5432885
[ fix ] indentation of impossible clauses (#1520) 2021-06-08 17:03:06 +01:00
Ruslan Feizerakhmanov
7aee7c9b7c
[ new ] --install-with-src; refactoring around FCs (#1450)
Why:

* To implement robust cross-project go-to-definition in LSP
  i.e you can jump to definition of any global name coming
  from library dependencies, as well as from the local project files.

What it does:

*  Modify `FC`s to carry `ModuleIdent` for .idr sources,
   file name for .ipkg sources or nothing for interactive runs.

*  Add `--install-with-src` to install the source code alongside
   the ttc binaries. The source is installed into the same directory
   as the corresponding ttc file. Installed sources are made read-only.

*  As we install the sources pinned to the related ttc files we gain
   the versioning of sources for free.
2021-06-05 12:53:22 +01:00
Edwin Brady
48f3825266
Merge pull request #1501 from edwinb/hash-fix
Read import hashes correctly
2021-06-03 23:13:10 +01:00
Edwin Brady
5fa272b8bf Read import hashes correctly
Need to use the 8 byte version of Ints for the shortcut version of
reading TTCs too, otherwise we'll read the wrong hash and build things
unnecessarily.
2021-06-03 21:57:10 +01:00
G. Allais
9e7625e613
[ log ] more readable output for elab.ambiguous (#1500) 2021-06-03 18:19:08 +01:00
Guillaume ALLAIS
6f839240c5 [ warn ] holes are not shadowed by implicits 2021-05-27 17:18:09 +01:00
Fabián Heredia Montiel
30c178c815
[ feature ] Implement -Werror (WarningsAsErrors) (#1466)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-05-27 09:23:20 +01:00
Edwin Brady
1329e69b5d
Merge pull request #1469 from edwinb/issue1365
Cache intermediate results in totality checking
2021-05-26 16:29:57 +01:00
Edwin Brady
a9b754e9fa Remove whitespace again
Didn't I just do this? Grr.
2021-05-26 15:54:57 +01:00
Edwin Brady
9cce0e1340 Remove whitespace in test file 2021-05-26 15:52:21 +01:00
Edwin Brady
68f6f4dbd5 Cache intermediate results in totality checking
This saves a lot of unnecessary exploring of size change graphs, which
can get over the top quite quickly if there's complex mutual
definitions, or even just a single function with an interesting variety
of recursive calls.

Fixes #1365
Fixes #1277
Fixes #645
2021-05-26 15:48:09 +01:00
Fabián Heredia Montiel
f1085b98a5 [ test #18 ] Add passing tests from issue to avoid regressions 2021-05-25 23:07:59 +01:00
Fabián Heredia Montiel
704a2525f1 [ fix #55 ] Propagate linear context from Definition to Clauses 2021-05-25 19:27:02 +01:00
Guillaume ALLAIS
6904cf5db6 [ :doc ] Adding projections to the record doc 2021-05-21 18:23:13 +01:00
G. Allais
e9f5038cb7
[ fix ] Version encoding should be stable (#1443) 2021-05-21 10:04:27 +01:00
Ohad Kammar
618c71477e
[ close #1384 ] built-in Snoc-lists [< 1, 2, 3 ] (#1383) 2021-05-20 12:56:25 +01:00
Guillaume ALLAIS
31a5175a02 [ re #1031 ] Disallow ? patterns on the LHS
We do this during desugaring because elaboration may insert valid
`?` values on the LHS (e.g. when elaborating things that cannot be
pattern-matched on and should be checked to be forced).
2021-05-20 10:23:00 +01:00
Edwin Brady
7f210b52aa Inline small metavariables
Where 'small' means they don't refer to other metavariables, except
right at the top level, and they don't go beyond a certain small depth,
arrived at by experimenting.

We already did a bit of this, but only for depth 0. The effect of this
is that we don't need to save out lots of metavariables, so ttc loading
is faster. This takes about 8s off the Idris build time!
2021-05-18 17:56:36 +01:00
Guillaume ALLAIS
ac4b31b41f [ fix #1421 ] Use resolved names for the impossible LHS 2021-05-17 21:06:37 +01:00
G. Allais
349308396c
[ fix #621 ] add warnings for shadowed global definition (#1407) 2021-05-14 17:35:21 +01:00
Edwin Brady
c87a6d52bb
Merge pull request #1400 from edwinb/tweak-cg
Some compilation/code generation improvements
2021-05-14 16:09:09 +01:00
Zoe Stafford
7fe8c42116
[ builtin ] O(1) integerToNat for any 'Nat'-like type (#1403) 2021-05-13 18:44:24 +01:00
Edwin Brady
f21a495711 Merge github.com:idris-lang/Idris2 into tweak-cg 2021-05-11 11:37:12 +01:00
G. Allais
ab241213f3
[ breaking ] making toList part of Foldable (#1395) 2021-05-11 08:26:00 +01:00
Zoe Stafford
8a7aeca1b0
[ builtin ] O(1) natToInteger for any 'Nat'-like type (#1363) 2021-05-10 12:14:19 +01:00
Guillaume ALLAIS
08d61d70c4 [ fix #1370 ] use the lambda's type for eta-expansion 2021-05-10 12:13:29 +01:00
Ohad Kammar
e58bcfc7ef
Semantic highlighting (#1335)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-05-10 09:05:43 +01:00
Edwin Brady
251d77b92d Swap 'False' and 'True' constructors
It has always bothered me that 'False' got mapped to tag 1 and 'True'
got mapped to tag 0. This doesn't change much in practice (except that
perhaps a code generator might notice some useful things in intToBool)
but I'm changing it now anyway. Also added a couple of inlinings of
boolean operations.
2021-05-09 20:08:38 +01:00
Edwin Brady
e8eab6d763 Flag records and option types
This saves a small amount of allocation, especially since we never
actually look at the tag in a record. We can use null? for Nothing just
like for Nil.
2021-05-09 16:49:59 +01:00
Johann Rudloff
4b7d85653a [ tests ] Add tests for :doc for records and single-constructor type 2021-05-06 14:38:55 +01:00
Johann Rudloff
62519c5352 Allow --directive command line flag combined with package options 2021-05-05 18:55:55 +01:00
Stefan Höck
6cdf05f1ec
[ new ] Add Int(8/16/32/64) (#1352)
This adds new `Int8`, `Int16`, `Int32` and `Int64` data types
to the compiler, thus working towards properly specified integer
types as discussed in #1048.

In addition, the following changes / corrections are made:

* Support casts from `Char`, `String`, and `Double` to all integer
  types (and back). This fixes #1270.
* Make sure that all casts to limited-precision integers are properly
  bounds checked (this was not the case so far for casts from `String`
  and `Double` to `Int`)
* Add a thorough set of tests to make sure all bounds checks work
  correctly for all supported casts and arithmetic operations
2021-05-04 08:22:06 +01:00
Guillaume ALLAIS
32f42e702a [ fix #1366 ] NType is not an NTCon 2021-05-03 13:52:01 +01:00
Edwin Brady
9e082730c2 Update test output
Some merges have made the output of tests change (due to internal
changes). This brings them up to date.
2021-05-01 17:37:38 +01:00
Edwin Brady
d6d68ff09b
Merge pull request #1195 from buzden/some-funs-to-lazy-list
[ contrib ] Some functions for lazy list + fix for `foldlM`
2021-05-01 16:18:24 +01:00
Edwin Brady
7f7b11ed54 Use transforms for fastPack/fastUnpack
We've had these for a while, used for interface specialisation, but
they're not yet used anywhere else or properly documented. We should
document them soon, but for now, it's a useful performance boost to
always use the fast versions of pack/unpack/concat at runtime.

Also moves a couple to the prelude, to ensure that the fast versions are
defined in the same place as the 'normal' version so that the
transformation will always fire (that is, no need to import Data.String
for the transformation to work).
2021-04-29 23:17:29 +01:00
Guillaume ALLAIS
d9176d47db [ fix #633 ] Pattern-matching on functions is illegal 2021-04-28 20:25:45 +01:00
G. Allais
96a2809f62
[ fix #1169 ] primitive types are not NTCon (#1340) 2021-04-28 09:33:27 +01:00
G. Allais
d32daaf36a
[ fix ] properly handle Namespace blocks for DocStrings (#1342) 2021-04-28 09:31:01 +01:00