Commit Graph

546 Commits

Author SHA1 Message Date
Edwin Brady
1c006b647a Reflect/reify for TTImp
This is further progress towards a metaprogramming system in a form
similar to Elaborator Reflection or Template Haskell, but trying to
avoid leaking too many implementation details of the elaborator itself.
2019-11-24 21:17:16 +00:00
Edwin Brady
f0da43156a Use latest bound name in building case function
We were using the least recently bound, leading to the wrong type being
shown in some cases with shadowing
2019-11-23 14:44:31 +00:00
Edwin Brady
2e9eabff71 Merge branch 'master' of github.com:edwinb/Idris2 2019-11-19 14:07:55 +00:00
Edwin Brady
17c83d6f4a
Merge pull request #137 from msmorgan/remove-trailing-whitespace
Remove trailing whitespace from Idris sources.
2019-11-18 20:44:46 +01:00
Edwin Brady
a3dc1ff228 Add ITransform to TTImp
This is for rewrite rules/transformations which arise from partial
evaluation. Details not yet implemented.
2019-11-13 17:57:39 +01:00
Edwin Brady
ca3ea38cde Make sure Force is erased for termination checker
But only for 'Lazy', not for 'Inf'. This is necessary to build the size
change graphs correctly.
2019-11-11 19:35:23 +00:00
Edwin Brady
ab98b4d3c9 Print banner before typechecking
Otherwise it hides the errors
2019-10-26 13:39:50 +01:00
Michael Morgan
e6121e0935 Remove trailing whitespace from Idris sources.
This is the result of running the command:

$ find . -name '*.idr' -type f -exec sed -i -E 's/\s+$//' {} +

I confirmed before running it that this would not affect any markdown
formatting in documentation comments.
2019-10-25 14:24:25 -07:00
Edwin Brady
f09138d508 Fix broken test 2019-10-25 17:32:29 +01:00
Edwin Brady
dab2bb36c1
Merge pull request #136 from clayrat/sourcedir
Add 'sourcedir' option to IPKG
2019-10-25 14:09:54 +01:00
Edwin Brady
3b73bf2813
Merge branch 'master' into sourcedir 2019-10-25 14:07:52 +01:00
Edwin Brady
779b09086b
Merge pull request #135 from ohad/bugfix-#133
Bugfix #133
2019-10-25 14:06:50 +01:00
Edwin Brady
da1964ce3d
Merge pull request #134 from ohad/bugfix-#109
Add multiple-parameter test as idris/basic029
2019-10-25 14:05:45 +01:00
Edwin Brady
c458957bd6 Get correct namespace in parameters blocks
Fixes #132. When getting the names in the block, we need to return the
fully explicit name, because we can't assume they'll all be in the same
namespace as we can have namespaces inside parameters blocks.
2019-10-25 14:03:15 +01:00
Alex Gryzlov
fcb337b3dc fix dir order & add comment 2019-10-24 20:45:16 +03:00
Alex Gryzlov
54ac723744 add sourcedir option 2019-10-24 20:33:28 +03:00
Ohad Kammar
604a55591b Bugfix #133: turn HasNames (List a) tail-recursive 2019-10-24 12:55:35 +03:00
Ohad Kammar
0cbb7d627c Merge branch 'master' of github.com:edwinb/Idris2 2019-10-24 00:07:30 +03:00
Ohad Kammar
90927cd886 Add multiple parameter block to test suite 2019-10-24 00:06:57 +03:00
Edwin Brady
bd96cf11be Add logTimeRecord
This allows recording cumulative time for specific operations, e.g. to
check how much time unification has taken overall. Not used in the
code as things stand, but useful enough as a debugging/profiling gadget
that I think it's worth committing.
2019-10-23 18:31:31 +01:00
Edwin Brady
e7a47178f2 Some micro-optimisations
Just a small effect, but noticeable, from avoiding branching the context
where it's not needed (in Ambiguity) and hand-inlining the Functor
instance for Binder in thin.
2019-10-23 18:31:31 +01:00
Edwin Brady
69992d483b
Merge pull request #131 from ohad/bugfix-#109
Add support for multi-parameter blocks
2019-10-23 18:29:17 +01:00
Ohad Kammar
2e41a3941f Add support for multi-parameter blocks
Fixes #109
2019-10-22 19:45:00 +03:00
Edwin Brady
a6d1d1b305 Remove a not-optimisation
If we're unifying applications, checking for conversion first is not a
shortcut because if it fails, we just have to redo the work, and if it
succeeds, that's more or less what we'd have done anyway! This is mostly
an issue when unifying really big expressions, which still take a long
time, but at least it's not as long.
2019-10-20 17:51:14 +01:00
Edwin Brady
83673b7295
Merge pull request #125 from msmorgan/list-head-tail
Add `head` and `tail` to base/Data.List.
2019-10-19 14:00:08 +01:00
Edwin Brady
da2b8365e2
Merge pull request #124 from clayrat/fix-clean
Fix --clean option
2019-10-19 13:58:52 +01:00
Edwin Brady
a1116632ae
Merge pull request #123 from abailly/with-match-constants
allow matching constants in with clauses
2019-10-19 13:56:41 +01:00
Edwin Brady
13a107e5ad
Merge pull request #121 from ohad/bugfix-#115
Bugfix #115
2019-10-19 13:55:12 +01:00
Edwin Brady
1a6c314d15
Merge pull request #119 from timsueberkrueb/add-missing-exports
Add some missing public exports
2019-10-19 13:53:23 +01:00
Edwin Brady
f6fd616d75
Merge pull request #118 from clayrat/parens-delay
Parenthesize delayed types/terms in errors
2019-10-19 13:46:55 +01:00
Edwin Brady
e680306321
Merge pull request #105 from ska80/version+tag
Add an optional version tag when building in between releases
2019-10-19 13:46:21 +01:00
Edwin Brady
7fab0110d3 Merge branch 'akuhlens-master' 2019-10-19 13:41:57 +01:00
Edwin Brady
1c304384e6 parseCmd might be empty 2019-10-19 13:41:25 +01:00
Edwin Brady
c7eac8c515 Merge branch 'master' of https://github.com/akuhlens/Idris2 into akuhlens-master 2019-10-19 13:34:34 +01:00
Edwin Brady
db0d904faf
Merge pull request #104 from ska80/fancy-banner
Add a fancy banner like in Idris 1
2019-10-19 13:26:56 +01:00
Edwin Brady
bb55ac5f1d Auto implicit search fix
Can't use a local which has 'erased' as its type, since that's just been
substituted in while working out how many arguments a local function
needs to have. Also need to ensure we've searched for default hints when
encountering IBindImplicits rather than after because otherwise it might
find the wrong instance.

Both these problems result it terms which don't type check getting past
the elaborator! So, also added a --debug-elab-check flag to check the
result of elaboration. It's not on by default because there are cases
where it really hurts performance, typically when inferring implicits
with lots of sharing. So we'll keep it as a debug flag, for now at
least.
2019-10-18 18:26:32 +01:00
Edwin Brady
d6d950f3dd Make sure Delay is put in the right place!
I got this wrong in the last patch - we need to go under the environment
where the guess was created. This will fix up the term so that it has
the right type after unification.
2019-10-17 18:06:33 +01:00
Edwin Brady
1febab885f Make sure Delay/Force inserted after unification
Always check the result to see if a laziness coercion needs inserting
2019-10-17 14:27:26 +01:00
Michael Morgan
33110d1cda Add head and tail to base/Data.List.
These functions use the NonEmpty predicate type in order to prove
that the operation will be valid.

Implementations copied from Idris1's Prelude.List module, except without
expanding the auto implicit argument.
2019-10-16 15:49:52 -07:00
Alex Gryzlov
6d58403a7e fix --clean 2019-10-16 19:02:58 +03:00
Arnaud Bailly
eedbf23f38 allow matching constants in with clauses fix #122 2019-10-15 21:52:44 +02:00
Ohad Kammar
34ef1745b6 Minor: fix whitespace 2019-10-15 16:05:10 +03:00
Ohad Kammar
12d9483ef4 Fix #115
Add an 'addName' function to Contex.idr interface for adding a new
name to the context.

Modify checkLock to always add the newly bound names to the context

The list of binding occurrences we iterate over must not have
duplicates, so we remove them with nub.
2019-10-15 15:59:30 +03:00
Kamil Shakirov
b87fd0beb3 Add optional version tag when build in between releases
Also add REPL :version command to show the current version
2019-10-14 12:01:29 +06:00
Kamil Shakirov
34f1f15bf4 Add a fancy banner like in Idris 1 2019-10-14 11:29:07 +06:00
Edwin Brady
4e019d8093 Tweak overloading rules
Instead of %allow_overloads, which I've never documented or explained,
now we have:
 + if there's more than one possible name after pruning according to
   return type, and there is at least one name with a concrete return
   type, rule out the names which do not have a concrete return type.

Effectively this means if there is a clash between a concrete name and a
polymorphic name, we'll always take the concrete one, which is
consistent with Idris 1.

I still don't know if this is the right choice, but all the possibile
ways of resolving ambiguity have some problems, and this is the fastest
to resolve in the common case!
2019-10-13 19:38:41 +01:00
Edwin Brady
50441ad3df Tweak evaluation rules under Delay
Still need to evaluate holes, if not all the names, because we may need
to bind implicits in types.
2019-10-13 19:36:44 +01:00
Edwin Brady
c572ce69b0 Improve implicit laziness
If the unification problem is delayed, and there's only one constraint,
allow inserting the laziness coercion when rechecking. We need this for
the situation where it's not yet known whether a term is lazy or not
(e.g. the laziness is computed by a type level function)
2019-10-13 18:24:52 +01:00
Edwin Brady
bb6d0e07a7 Fix pruning ambiguities under 'Delayed'
Need to strip the 'delayed' or we'll miss some things
2019-10-13 17:09:31 +01:00
Edwin Brady
6cebc5ca4f Add some handy list functions/properties 2019-10-13 13:59:42 +01:00