Commit Graph

773 Commits

Author SHA1 Message Date
David Raymond Christiansen
7cd0989259 Fix test when Idris is compiled with Curses support 2015-11-27 12:32:04 +01:00
Echo Nolan
8a17e9afe5 Change library and expected test results for Float -> Double change
I changed everything but the reflection and builtin stuff. I don't know
enough to mess with that. So there are a bunch of warnings for
Language.Reflection etc.
2015-11-26 01:26:05 -08:00
Edwin Brady
140d06ab0a Move normalisation of deferred types
No need to do this when collecting deferred names, just do it for
display purposes. It's safer anyway, due to potential name clashes in
the normalisation. Fixes #2806
2015-11-15 13:29:24 +00:00
Edwin Brady
3d2fa6c422 Better elaboration of applications
Sometimes elaboration of applications failed unnecessarily because we
assumed they'd have a simple type, and there'd be a strange error
reported if they didn't. Now use proper dependent application, and drop
back to the original simple version if the type of the function can't be
inferred.
2015-11-15 00:23:17 +00:00
Edwin Brady
bde101fbd0 Better inference for case blocks
Now look at the type of the patterns to infer what the argument type of
the new function should be. This helps if, for example, the scrutinee
function has some type which needs to be resolved to a specific type
class instance, and we can't do this from the scrutinee alone.
2015-11-14 19:15:39 +00:00
Edwin Brady
6011227566 Fix regression with making class bodies
:ac should add a class body when given a class name, but a previous
change stopped this working. Test added to prevent similar accidents in
future.
2015-11-14 17:46:05 +00:00
Edwin Brady
b1872fb189 File IO type indicates possibility of failure
At the cost of having to check the result, file IO operations no longer
silently fail, so you won't get a segfault on trying to read a
non-existent file any more.

Pattern matching alternative notation makes this not too painful (see
Prelude.File.readFile for example)

Also, versions which throw exceptions instead could be implemented in
IOExcept, if exceptions are preferred.
2015-11-01 01:17:16 +00:00
Niklas Larsson
ad9ef67ecf Merge pull request #2775 from bravit/fix/master/withpats
Fix issue #2666 (Invalid syntax accepted)
2015-10-30 22:53:57 +01:00
Niklas Larsson
9963bbee58 Merge pull request #2759 from jeremy-w/jeremy-w/improve-filename-error-messages
PParser.hs: filename: Report the specific failed check on error
2015-10-30 21:34:32 +01:00
Vitaly Bragilevsky
918440e965 Fix issue #2666 ("with" patterns accepted outside of "with" block)
Parser parses clauses independently so there is no parsing error
in code like this:

    foo : Int -> Bool
    foo 1 | 2 | 3 = True
    foo _ = False

Elaborator can check if it sees with patterns but no enclosing with block,
so we report error in situations like this.
2015-10-30 08:38:39 +03:00
David Christiansen
7b30b6d0bc Merge pull request #2749 from david-christiansen/pruviloj
Pruviloj and Elab updates
2015-10-25 17:25:47 +01:00
Edwin Brady
467490be40 Better case split when all patterns are impossible
When there are no valid cases, instead of deleting existing patterns and
displaying nothing, output "impossible" cases for all the constructors.
2015-10-24 13:53:18 +01:00
Jeremy W. Sherman
429db44ecb test/pkg003: Remove generated executable
It was trying to rm -f a similar but different filename, which left an
executable hanging around after the test.
2015-10-23 19:46:50 -04:00
Jeremy W. Sherman
a636f96bdc Update pkg004/expected for more specific error message 2015-10-23 19:46:22 -04:00
Niklas Larsson
f0f1d72848 Merge pull request #2761 from melted/fix_pkg_opts
Make the pkg tests take the same display options as the other tests.
2015-10-23 15:39:41 +02:00
Niklas Larsson
31d6ed1e42 Make the pkg tests take the same display options as the other tests.
"--nocolour --quiet --consolewidth 80"
2015-10-23 14:20:19 +02:00
Niklas Larsson
5a8536ad14 Merge pull request #2677 from zgrannan/repl-check-operator
Parse operators as expressions in the REPL
2015-10-23 13:51:27 +02:00
David Raymond Christiansen
58ddcd09bc Add derivation of DecEq to Pruviloj 2015-10-19 01:34:40 +02:00
Edwin Brady
a35ccd6adb Update Eff constructors to remove warnings 2015-10-17 20:22:08 +01:00
Edwin Brady
da914af83e Consistency of implicit/pattern name binding rules
We've always said that the rules for binding names in patterns are the
same as the rules for binding names in implicits, i.e. a name beginning
with a lower case letter, not applied to anything, will be bound
implicitly, or treated as a pattern variable. This hasn't actually
always been quite true, even though it was supposed to be...

Correspondingly, added a warning for constructor names which may be
unexpectedly bound implicitly.

This patch changes the pattern binding rules so that it is the case.
Fixes #2653
2015-10-17 18:44:00 +01:00
Edwin Brady
83f0af13fb Display expected type of RHS in error messages
Also added %error_reverse annotations on IO so that IO related messages
are more readable. This improves the error in #2672.
2015-10-17 14:30:36 +01:00
David Christiansen
c98e24f2cc Merge pull request #2746 from david-christiansen/pruviloj
Elab updates
2015-10-16 19:47:35 +02:00
David Raymond Christiansen
f7e1990ce4 Add lookup of FunArgs for global names to Elab
This makes it possible to write elaborators for term languages that use
Idris's plicity information. As a test of this, the test suite now
includes a mini-implementation of a subset of Agda's reflection using
Elab.
2015-10-16 18:55:24 +02:00
David Christiansen
c5f5dab91e Merge pull request #2741 from david-christiansen/pruviloj
Pruviloj-related updates
2015-10-16 07:56:55 +02:00
David Raymond Christiansen
5330e8a00c Simplifications to Elab
apply is simplified and forget has been moved to library code.
2015-10-16 01:24:38 +02:00
David Raymond Christiansen
ab62c98f99 Make cycle test work with Curses Idris 2015-10-16 01:02:26 +02:00
Niklas Larsson
d2f892b502 Merge pull request #2728 from jeremy-w/jeremy-w/ipkg-allow-arbitrary-executable-names-2721
IPKG: Relax requirement that executable name be a valid identifier [#2721]
2015-10-14 23:22:39 +02:00
Edwin Brady
8bd99edf3e Detect cycles in imports
Also improve import chasing, by only following imports in the current
source tree (so not in dependencies we happen to have the source for,
which will be part of other packages)
2015-10-14 15:37:21 +01:00
Jeremy W. Sherman
4f96945a3b Test that IPKG rejects executable with directory component
This ensures it really is a filename, and prevents something unwanted like
telling it to write to ../something or /something.
2015-10-13 00:00:59 -04:00
Jeremy W. Sherman
a22dd61eac Add test that quoted strings with valid filenames are OK
This tests the new functionality added to support hyphens in filenames
(see: https://github.com/idris-lang/Idris-dev/issues/2721).
2015-10-12 23:33:03 -04:00
Jeremy W. Sherman
4274456d4d Add test that IPKG executable accepts namespaced identifier
This tests that the current behavior of Idris when parsing the target
executable name is preserved.
2015-10-12 23:32:44 -04:00
Edwin Brady
2cda43e36c Update docs test 2015-10-09 15:51:00 +01:00
David Raymond Christiansen
d5b66a9188 Show source location of case block names
Names for case block functions (such as "case block in f") now show the
source location from which they originated. This will make it easier to
diagnose problems like totality warnings coming from case blocks,
staging restriction errors from %runElab, and similar.
2015-10-09 10:31:17 +02:00
David Raymond Christiansen
83aa146947 Stop let-binding Elab scripts around their holes
This prevents them from showing up in intermediate elaboration states
and making things difficult to read.
2015-10-08 21:11:33 +02:00
Zack Grannan
2c91acc319 Changed to not affect normal expression parsing 2015-10-06 05:12:15 +00:00
Zack Grannan
a8f7652f2a Update tests 2015-10-05 21:41:47 -07:00
Zack Grannan
14cf196d97 Added tests 2015-10-05 21:41:47 -07:00
David Raymond Christiansen
76bcaf2fa3 Add the ability to look up if a name is a TC to Elab
Now, Elab scripts can check whether a name denotes a type class.
2015-10-02 09:21:22 +02:00
David Raymond Christiansen
c9973eb7c3 Add andThen and refine to Pruviloj
andThen is a subgoal sequencing combinator, and refine is a bit like
Coq's eapply.
2015-10-01 18:28:40 +02:00
Jan de Muijnck-Hughes
ae7bdd1f22 Added missing expected file 2015-09-28 13:32:33 +01:00
Jan de Muijnck-Hughes
824d0e3ea2 Fixed mistake and added test 2015-09-28 12:39:35 +01:00
David Raymond Christiansen
02abb9a431 Library of tactics for proof automation with Elab
I'm collecting all the various tactics that I've defined in my various
projects that have proven to be useful and making them into an
includable library, both as an example of Elab reflection and to have a
semi-standard vocabulary.
2015-09-25 13:24:42 +02:00
David Raymond Christiansen
ce403f6c60 Merge remote-tracking branch 'upstream/master' into wip/tactical
Conflicts:
	CHANGELOG
2015-09-23 13:24:36 +02:00
Edwin Brady
f1ffd5c636 Add new test for matrix transposition
Also ensures that 'elem' is okay to use as an unbound implicit.
2015-09-22 11:45:17 +01:00
Edwin Brady
b678d7c93c Changed scoping rules for unbound implicits.
Any name which would be a valid unbound implicit is now *always* an
unbound implicit. This is much more resilient to changes in inputs, but
does require that function names be explicitly qualified when in
argument position.

Updated libraries/tests accordingly.

WARNING: This is likely to break some code; the fix is, in all cases, to
give explicit namespaces for function names in types in an argument
position (i.e. a valid position for it to be an unbound implicit).
2015-09-21 17:23:33 +01:00
David Raymond Christiansen
30f55ced5f Merge remote-tracking branch 'upstream/master' into wip/tactical
Conflicts:
	CHANGELOG
	src/Idris/AbsSyntaxTree.hs
2015-09-19 14:23:20 +02:00
David Christiansen
6d7d3bdba1 Merge pull request #2630 from david-christiansen/namesInQQ
Make name operations on PTerm quotation-aware
2015-09-19 08:54:55 +02:00
David Raymond Christiansen
071d34b3fc Make name operations on PTerm quotation-aware
This fixes an obscure issue where certain do-bound names that did not
shadow, but were identical to, other do-bound names in different
subexpressions of one larger expression would fail when referred to in
antiquotations. Example:

    (do h <- gensym
        claim h a
        fill `(C1 ~(Var h)); solve) <|>
      (do h <- gensym
          claim h b
          fill `(C2 ~(Var h)); solve)

The second antiquoted h would throw a "No Such Variable" error, because
the second lambda-bound h was renamed at one point without its use site
being renamed similarly.
2015-09-18 23:20:02 +02:00
Niklas Larsson
abc76e137a Merge pull request #2619 from david-christiansen/substr-2
Be more thorough in substring testing
2015-09-17 00:41:44 +02:00
David Christiansen
3a32759711 Merge pull request #2603 from Melvar/shift-vect
Merge Data.VectType into Data.Vect, and cleanup
2015-09-15 17:05:28 +02:00