Commit Graph

808 Commits

Author SHA1 Message Date
Mort Yao
c9a05f4d5a Update tests to reflect the change of idris_readStr 2015-04-14 15:11:03 +08:00
David Raymond Christiansen
f1c6e39dba Merge remote-tracking branch 'refs/remotes/upstream/master' into wip/tactical 2015-04-10 10:17:10 +02:00
Niklas Larsson
68d844cdf8 Added a test for bignums 2015-04-10 09:49:28 +02:00
David Christiansen
bedca84d6f Merge pull request #2106 from melted/great_expectations
Don't require expect for tests with timeouts
2015-04-09 16:21:35 +01:00
David Christiansen
dbc767bf8d Merge pull request #2110 from melted/variable_expectations
Make a mechanism for os-dependent output of tests
2015-04-09 16:20:28 +01:00
David Raymond Christiansen
c3def79a99 Rename Tactical to Elab 2015-04-08 10:46:57 +02:00
sualitu
8e112d79ee Added tests 2015-04-06 12:16:57 +02:00
Edwin Brady
46c3081179 Disable effects004 on js tests
JS back end doesn't implement LReadStr primitive
2015-04-05 22:27:46 +01:00
Edwin Brady
e9e74a664f Forgot to commit effects004 2015-04-05 21:31:01 +01:00
Edwin Brady
c3cdb9c465 Trying a new Effects api
Changes:
- Eff has become EffM, parameterised over (m : Type -> Type), which will
  allow us to introduce new effects later, though not currently used
- Eff itself is now a collection of type synonyms which build an EffM.
  It can take either one list of effects, a list of input and output
  effects, or a list of effects and a function to compute output
  effects; disambiguated by context
- EffT is as Eff, but takes the underlying 'm'
- Added 'sig' function for giving effect signatures.

All of the above mean we no longer need the {} syntactic sugar, though
it's still there. Old effect programs (should!) work with no or minimal
changes.
2015-04-05 17:42:54 +01:00
Niklas Larsson
c47608d968 Don't require expect for tests with timeouts
Turns out there's a timeout command in core utils that is
convenient.

Fixes basic010 and reg039 on Windows.
2015-04-03 17:38:42 +02:00
David Christiansen
03c2672d76 Merge pull request #2097 from melted/fix_ffi006
Don't hardcode 'cc' as the compiler
2015-04-03 13:57:59 +02:00
Niklas Larsson
a6475a2093 Make a mechanism for os-dependent output of tests
Fixes interactive007 on Windows.
2015-04-03 13:45:03 +02:00
Edwin Brady
5d269e39d1 :exec can take an expression as an argument
This compiles the expression and evaluates it. It will either print the
expression (if its type is an instance of Show) or run it (if its type
is IO ()), or give an error otherwise.
2015-04-03 11:48:04 +01:00
Heather
d2bcf5da0a runtest.pl fix error when there is no sandbox 2015-04-03 11:28:01 +04:00
Niklas Larsson
e643ef61ad Don't hardcodee 'cc' as the compiler
Fixes ffi006 on windows
2015-04-03 01:04:24 +02:00
David Christiansen
7871ecbe26 Merge pull request #2096 from melted/win_test
Make reg029 pass on Windows
2015-04-02 08:19:23 +02:00
Niklas Larsson
1592354e56 Make reg029 pass on Windows 2015-04-01 21:18:37 +02:00
Niklas Larsson
8cc2312715 Don't let tests depend on colouring. 2015-04-01 20:50:06 +02:00
David Christiansen
663c401154 Merge pull request #2094 from david-christiansen/no-type-checking-message-quiet
Make --quiet imply non-verbosity
2015-04-01 19:02:09 +02:00
David Raymond Christiansen
6c4553c31f Make --quiet imply non-verbosity
This causes Idris to not emit messages about "Type checking ...." while
in quiet mode, which improves the portability of tests to Windows (due
to the slash facing the other way there). It also makes tests a bit more
robust with regards to their source files changing names.
2015-04-01 17:48:17 +02:00
sualitu
9c13628838 Merge branch 'master' into agda-style-records 2015-04-01 15:35:11 +02:00
Niklas Larsson
9f5fb0823c Need to wrap PATH in quotes to avoid chars being interpreted as shell
Notable on windows where it is likely there is a directory with
parantheses in the name.
2015-04-01 15:33:00 +02:00
sualitu
26dba597f7 Merge 2015-03-31 21:06:34 +02:00
David Raymond Christiansen
73795745e0 Fix test/proof009 when Curses is enabled 2015-03-31 12:33:15 +02:00
David Raymond Christiansen
a13b22ca9d Merge branch 'lambda-impossible' of https://github.com/Melvar/Idris-dev into Melvar-lambda-impossible 2015-03-31 11:24:23 +02:00
Edwin Brady
13a36a3d32 Annotate functions as %hint for auto search
This allows extra hints, as well as constructors, to guide proof search
for auto implicit arguments.
Added test proof010 which shows how this works to simulate type classes
with overlapping instances (and consequently no injectivity restriction
or assumption)

%hint only works on functions which return an instance of a data type.
Proof search exhaustively searches hints and constructors, so use with
care especially when adding lots of recursive or overlapping hints.
2015-03-29 21:24:04 +01:00
Edwin Brady
73ea02b205 Remove Buffer and BitVector from parser
They are not properly tested, and ideally should be implemented via FFI
in specific back ends.
2015-03-28 17:47:05 +00:00
Edwin Brady
c4132807f0 String in C is now UTF8 encoded
Primitives for head/tail/index/cons/reverse/length now all assume the
char* is UTF8 encoded.  Also updated generation of literals to encode as
UTF8.  Primitives are probably not as efficient as they could be (though
some of the will be used rarely)

ASCII strings will work exactly as before.

Everything I know about UTF8 encoding has been learned in the past few
hours. Therefore, this is unlikely to be the best way to do this. Please
educate me, ideally in the form of annotated Pull Requests :).
2015-03-28 17:13:59 +00:00
Melvar Chen
fc9839cd0a Add test for impossible in lambda and case 2015-03-27 23:38:40 +01:00
Edwin Brady
2d503f1c8a Fix interactive prover
safeForget broke things due to missing case. Also added a test to ensure
it doesn't happen again.
2015-03-23 19:51:15 +00:00
David Christiansen
cea78700e2 Merge pull request #2028 from david-christiansen/issue/1172
Prevent variable capture when desugaring custom syntax
2015-03-23 10:06:28 +01:00
Edwin Brady
cef878045f Fix constraint generation/tests 2015-03-22 13:19:27 +00:00
Edwin Brady
6c673c25d5 Change Solver to use ConstraintFC, not a pair 2015-03-22 12:37:55 +00:00
Ozgur Akgun
7fe57bf722 only adding constraints to the queue when the relevant bound is updated 2015-03-22 11:35:18 +01:00
David Raymond Christiansen
14b702511f Merge remote-tracking branch 'refs/remotes/upstream/master' into issue/1172
Conflicts:
	idris.cabal
2015-03-22 10:50:29 +01:00
David Raymond Christiansen
8fce3b9cc0 Avoid test clash with upstream 2015-03-22 10:49:17 +01:00
Edwin Brady
9284294142 Add fc to universe error message 2015-03-21 16:02:08 +00:00
David Christiansen
abe0f322a0 Merge pull request #2027 from david-christiansen/issue/2019
Better documentation display for instances
2015-03-20 23:23:09 +00:00
Edwin Brady
be1569e66d Fix type class name propagation issue
We weren't shadowing names correctly when a class was parameterised on a
single variable and one of the methods bound the same name. This almost
never happens, but leads to very odd error messages when it does.

Fixes #2026
2015-03-20 19:55:51 +00:00
David Raymond Christiansen
50d7dce425 Prevent variable capture when desugaring custom syntax
Fixes #1172.
2015-03-20 16:51:40 +01:00
David Raymond Christiansen
beda221e93 Improve display of documenation for named instances 2015-03-20 14:01:49 +01:00
David Christiansen
3d818586c3 Merge pull request #2007 from david-christiansen/library-reorg
Initial reorganization into contrib
2015-03-20 10:17:48 +00:00
Sune Alkærsig
bbbe8803c9 Merged. 2015-03-20 09:27:49 +00:00
David Raymond Christiansen
5ddd0244be Merge remote-tracking branch 'refs/remotes/upstream/master' into library-reorg
Conflicts:
	CHANGELOG
	libs/prelude/Prelude/Applicative.idr
	libs/prelude/Prelude/Functor.idr
	libs/prelude/Prelude/Monad.idr
2015-03-19 20:43:56 +01:00
Andreas Reuleaux
5b5da7ad17 typo in unique001 test corrected 2015-03-19 19:05:49 +00:00
Andreas Reuleaux
3e40420e90 adjust test unique003 with --consolewidth for use with -f curses 2015-03-19 18:54:38 +00:00
Andreas Reuleaux
5d4d793186 adjust test tutorial006 with --consolewidth for use with -f curses 2015-03-19 18:51:22 +00:00
Sune Alkærsig
95964635f0 Merge branch 'master' into agda-style-records 2015-03-19 18:50:14 +00:00
Sune Alkærsig
7d42ba28d7 Changed tests for new record syntax. 2015-03-19 18:49:21 +00:00
Andreas Reuleaux
2a7d6a96b9 adjust test totality008 with --consolewidth for use with -f curses 2015-03-19 18:47:38 +00:00
Andreas Reuleaux
d0310fda39 adjust test unique002 with --consolewidth for use with -f curses 2015-03-19 18:36:28 +00:00
Andreas Reuleaux
7da6edae29 adjust test unique001 with --consolewidth for use with -f curses 2015-03-19 18:32:49 +00:00
Andreas Reuleaux
343e956085 adjust test totality007 with --consolewidth for use with -f curses 2015-03-19 18:27:16 +00:00
Andreas Reuleaux
694bdf64d8 adjust test totality006 with --consolewidth for use with -f curses 2015-03-19 18:12:12 +00:00
Andreas Reuleaux
999412f244 adjust test totality004 with --consolewidth for use with -f curses 2015-03-19 18:08:19 +00:00
Andreas Reuleaux
c193a40710 adjust test totality003 with --consolewidth for use with -f curses 2015-03-19 17:44:50 +00:00
Andreas Reuleaux
d9482ae69d adjust test totality002 with --consolewidth for use with -f curses 2015-03-19 17:33:42 +00:00
Andreas Reuleaux
6bac17b37d adjust tests with --consolewidth for use with -f curses 2015-03-19 17:24:36 +00:00
David Raymond Christiansen
e1f139a989 Library rearrangement done. 2015-03-19 18:09:53 +01:00
Andreas Reuleaux
8ab6beac57 Merge remote-tracking branch 'upstream/master' into issue2004 2015-03-19 16:50:54 +00:00
Andreas Reuleaux
5de1cd81dc adjust tests with --consolewidth for use with -f curses 2015-03-19 16:50:50 +00:00
Edwin Brady
f4aaf01b34 Guard !! in forgetEnv
This means we get better error messages if there are scoping issues,
particularly as caused by 'where' clauses with missing types that can't
be inferred.

Fixes #1978
2015-03-19 16:23:43 +00:00
Andreas Reuleaux
174395b22c Merge remote-tracking branch 'upstream/master' into issue2004 2015-03-19 15:36:23 +00:00
Andreas Reuleaux
a5e76fc00a adjust tests with --consolewidth for use with -f curses 2015-03-19 15:36:18 +00:00
Andreas Reuleaux
9cfd0c2025 adjust test with --consolewidth for use with -f curses 2015-03-19 14:57:21 +00:00
Andreas Reuleaux
d0a9beb12e adjust tests with --consolewidth for use with -f curses 2015-03-19 14:42:12 +00:00
Edwin Brady
15737d9c4b Trickiness with implicits in dependent classes
Need to expand implicits for methods in the dictionary declarataion, but
not quite the same way as for the top level function of the same name
(i.e. need to leave out the dictionary itself).

Fixes #1975
2015-03-19 12:56:05 +00:00
Andreas Reuleaux
73da7d472c adjust tests with --consolewidth for use with -f curses 2015-03-19 12:26:17 +00:00
Andreas Reuleaux
7a91805bd6 adjust test with --consolewidth for use with -f curses 2015-03-19 12:00:47 +00:00
Andreas Reuleaux
62419f47ad set console width / adjust tests by using --consolewidth to make them work with the curses flag 2015-03-19 11:50:39 +00:00
Andreas Reuleaux
b989e3661f dead code: renderWidth nowhere used 2015-03-18 19:03:35 +00:00
Andreas Reuleaux
aa338657cc Merge remote-tracking branch 'upstream/master' into issue2004 2015-03-18 09:55:54 +00:00
Andreas Reuleaux
1bf27316b5 issue #2004 resolved by --consolewith cmd line param 2015-03-18 09:55:37 +00:00
David Raymond Christiansen
361efb574e Merge remote-tracking branch 'refs/remotes/upstream/master' into wip/tactical 2015-03-18 01:19:58 +01:00
Edwin Brady
147149b432 Add 'determining parameters' for classes
Also fix resolution rules so that determining parameters, in *all cases*
except Num instances (for defaulting to Integer), must not be
metavariables.

Syntax is:

class Foo a b c | a, b

the optional | a, b lists the determining parameters. When resolving
Foo, a and b must not be metavariables. c can be a metavariable (and
hence solved by type class resolution).

The overlapping instance check now only looks at determining parameters,
so, for example, for Foo the following instances would be considered
overlapping:

instance Foo Int Nat Bool
instance Foo Int Nat String
2015-03-17 23:54:45 +00:00
David Raymond Christiansen
c2dc6ec7dd Allow new-style tactics to declare function signatures
Docs forthcoming.
2015-03-17 21:22:03 +01:00
David Raymond Christiansen
a39fef32c1 Merge branch 'fix/print-semantics' of https://github.com/jfdm/Idris-dev into jfdm-fix/print-semantics
Conflicts:
	CHANGELOG
2015-03-17 11:10:05 +01:00
Edwin Brady
01c4f2a39c A bit more unification error provenance 2015-03-16 19:39:48 +00:00
Edwin Brady
179c704362 Record provenance of types in 'fill' errors
This covers unification errors arising from variables and function
applications (which is a lot of them)
2015-03-16 18:27:19 +00:00
Adam Sandberg Eriksson
54fb787ac1 Documentation for provided postulates 2015-03-15 15:16:12 +01:00
David Christiansen
ad2f1864e4 Merge pull request #2000 from david-christiansen/better-fin-error
Better Fin error
2015-03-15 12:17:11 +00:00
David Raymond Christiansen
c6661660ad Improve Fin error rewriter to remove "fromInteger"
"fromInteger" now never shows up in the errors, at least not applied to
an Integer constant.
2015-03-14 22:27:29 +01:00
David Raymond Christiansen
d3649824df Improve rewriter for Fin.fromInteger
It now offers different errors when it couldn't prove the lemma due to
having a variable for the Integer, or when it couldn't prove it due to
having concrete values that are directly incorrect.
2015-03-14 20:20:44 +01:00
Adam Sandberg Eriksson
6fe15ea096 Allow type providers to have docstrings 2015-03-14 01:18:32 +01:00
Adam Sandberg Eriksson
ccc2af014a instance docs: rename testcase 2015-03-13 22:46:21 +01:00
Adam Sandberg Eriksson
9bc0b4a79e Instance docs: fix test case 2015-03-12 11:54:51 +01:00
Adam Sandberg Eriksson
7ba4da0013 Instance docs: instance parameter documentation 2015-03-11 22:17:39 +01:00
Adam Sandberg Eriksson
8855d2503b Instance docs: align instance doc with member doc 2015-03-10 10:48:31 +01:00
Adam Sandberg Eriksson
75bf0d8242 Instance docs: simplify test case 2015-03-10 10:43:43 +01:00
Adam Sandberg Eriksson
540f817cc4 Instance docs: add one test case 2015-03-09 18:01:51 +01:00
Edwin Brady
e9c96d40c4 Add test for FFI export (ffi006) 2015-03-07 22:09:52 +00:00
Jan de Muijnck-Hughes
ec617e8f06 Updated changelog 2015-03-06 17:26:33 +00:00
Jan de Muijnck-Hughes
5ea6aa0520 Address semantic differences in putting things to STDOUT.
The changes are as follows:

+ `print` is for putting showable things to STDOUT.
+ `printLn` is for putting showable things to STDOUT with a new line
+ `putCharLn` for putting a single character to STDOUT, with a new line.

Effects has been updated accordingly.
2015-03-06 17:26:33 +00:00
David Raymond Christiansen
29553b639a Prevent unquotations from being parsed as infix operators 2015-03-05 16:22:51 +01:00
David Raymond Christiansen
a1c42ad4c9 Add "rewrite" to new-style tactics 2015-03-02 22:02:36 +01:00
David Raymond Christiansen
c70b2a310a Merge branch 'feature/betteroperatormessage' of https://github.com/ahmadsalim/Idris-dev into ahmadsalim-feature/betteroperatormessage
Conflicts:
	test/reg050/expected
2015-03-02 16:02:41 +01:00
David Raymond Christiansen
3c05bcd075 Merge branch 'dsl_varnames' of https://github.com/chetant/Idris-dev into chetant-dsl_varnames 2015-03-02 12:42:33 +01:00
David Raymond Christiansen
6f25fbe6cc Update reg050 for <$> as fmap alias 2015-03-02 11:28:04 +01:00
David Raymond Christiansen
48d6a6bcf9 Update for renamed operators 2015-03-02 10:57:06 +01:00
Tenor Biel
b5f2e4df50 Changed test expectations to support new Prelude operators 2015-03-02 10:08:41 +01:00
Tenor Biel
44bdf1dd40 Changed (<$>) to (<*>) 2015-03-02 10:08:22 +01:00
Chetan Taralekar
3b5790caf9 Named lambda,let,pi in dsl block 2015-03-01 22:34:17 -06:00
Ahmad Salim Al-Sibahi
ef906d30a0 Fixed test error due to improved error message (the test had expected the old
message)
2015-03-01 20:44:28 +01:00
David Raymond Christiansen
5f2a3b5d20 Simplify comment parser
Since we no longer have special documentation comments, the comment
parser can be much simpler. The simpler version also works better - it
fixes #1958.
2015-02-27 14:32:02 +01:00
Ahmad Salim Al-Sibahi
dcbab5e67b Fixed failing regression test due to new syntax extension rules 2015-02-24 21:42:00 +01:00
David Raymond Christiansen
f327f18528 Raw quasiquote patterns
Now, Raw terms can be quasiquoted in a pattern context.
2015-02-21 09:38:33 +01:00
Edwin Brady
2758aae99a Merge branch 'wip/tactical' of https://github.com/david-christiansen/Idris-dev into david-christiansen-wip/tactical 2015-02-20 11:07:36 +00:00
David Raymond Christiansen
b04814059f Overloaded quasiquotations
Now, quasiquotations can generate Raw terms in addition to TT terms.
2015-02-20 08:29:24 +01:00
Edwin Brady
4d1759e394 Pair syntax for unique types
This works only if the elaborator is in a context where it is expecting
a unique type (or a Type*) rather than a normal type. This is
EXPERIMENTAL but should(!) not cause any issues in code which uses no
unique types or Type*
2015-02-19 11:09:15 +00:00
David Raymond Christiansen
f17606a49a "claim" and "unfocus" tactics
This commit introduces:
 * A new tactic "claim N TY" that introduces a new hole named N with
   type TY
 * A new tactic "unfocus" that moves the current hole to the bottom of
   the hole stack

In the process of this and some other work, I also added comments and
docs to more of the core.
2015-02-17 14:19:45 +01:00
Edwin Brady
c918f44d4b Merge branch 'master' of github.com:idris-lang/Idris-dev
Conflicts:
	src/Idris/Core/Elaborate.hs
2015-02-14 14:05:25 +00:00
Edwin Brady
26cfbe9e1e Scoped implicits fix
If after an application there are more implicit arguments expected, add
those arguments then re-elaborate the application - we often don't know
what these arguments will be until after elaborating the application
because the application itself may compute a type.

Fixes #1899
2015-02-14 13:58:06 +00:00
David Raymond Christiansen
54451e4626 Test case that was accidentally accepted before 2015-02-11 17:50:01 +01:00
Edwin Brady
e4cf620eed Merge branch 'master' of github.com:idris-lang/Idris-dev 2015-01-31 12:30:09 +00:00
Edwin Brady
ef75f3ca30 Disable backend-dependent test 2015-01-20 14:54:39 +00:00
Edwin Brady
794852acf1 Initial support for JS in new ffi 2015-01-20 10:57:55 +00:00
Edwin Brady
9150698428 Primitive type for world state
This means we can make primitives for reading/writing file handles which
are given the world state, so can be written more safely. Also, a
minimal back end can implement these rather than implementing an entire
FFI.

Updated primitive LReadStr (which can now reasonably be total, like any
foreign function, because it has a world state) and added primitive
LWriteStr.
2015-01-18 00:14:38 +00:00
Edwin Brady
d5377be628 New language-dependent FFI
More documentation to follow, but in brief:
- IO is now a synonym of IO' FFI_C
- IO' is parameterised over an ffi description, which explains which
  types are allowed in foreign calls, and what a foreign call target is
  (in C, that's a String giving the function name, for example)
- New function "foreign" for building a foreign call, given an ffi
  description, call target, and the type of the call. The type is enough
  to build a structure which the compiler uses to generate the call.

The type of main now needs to be IO' x (), where x can be any FFI
description.

There is currently only an ffi description for C; Javascript will
follow. FFI_C should also work for the llvm backend (it's really about
the calling convention, not the backend specifically). Small changes
will be needed to the various code generators.
2015-01-17 19:08:33 +00:00
Dmitry Bushev
39c07a7913 Proper REPL module reloading
Fixes #1587
2015-01-15 10:04:36 +03:00
David Christiansen
02d26ec1dc Merge pull request #1841 from david-christiansen/issue/1806
Replace _ patterns with fresh variables under @-patterns
2015-01-13 08:30:40 -08:00
Edwin Brady
c729d2f868 Support scoped type class constraints
Limitation: the type class constraint must be under a scoped implicit
(this is purely for parsing reasons, although I also can't immediately
think of a reason you'd want this except under an implicit...)
2015-01-12 01:09:49 +00:00
David Raymond Christiansen
48fd8429d9 Better test for @-_-desugaring 2015-01-10 17:58:59 -08:00
David Raymond Christiansen
0b23ef2a19 Replace _ patterns with fresh variables under @-patterns
Also, add test.

Fixes #1806.
2015-01-10 17:13:00 -08:00
David Raymond Christiansen
5088572bd8 Fix Curses craziness in test + missing test file 2015-01-03 22:01:21 -08:00
David Raymond Christiansen
6b803b7b63 Allow documentation for modules
The syntax is the same as for other documentation, right before the
"module" declaration. For an example, see the "idrisdoc009" test. Terms
in module documentation are elaborated in a context including all of its
imports and definitions, so the documentation can provide examples and
descriptions.

The :doc command now also shows documentation for modules.
2015-01-03 19:14:20 -08:00
Edwin Brady
7c34217af9 Allow class constraints to be named
Like so:
foo : (c : Show a) => List a -> String

This means that type classes can be used as indices/parameteres of data
types (e.g. to ensure a dictionary is unchanging across a structure).
Fixes #646
2015-01-01 22:51:47 +00:00
Edwin Brady
ed58a4b4d5 Add missing test file 2015-01-01 17:21:28 +00:00
Edwin Brady
bb0162f34f Can't run effects003 on node 2015-01-01 17:09:08 +00:00
Edwin Brady
3874926bbd Add Hangman example to tests
This has caught some regressions for me a few times so should be useful
here too.
2015-01-01 16:59:49 +00:00
Edwin Brady
43127b17a7 Move Fin, Vect and So from prelude to base
They can be imported from the modules Data.Fin, Data.Vect, and Data.So
respectively.

The general thinking here is that not every program is going to need
these, and they are often used especially by newcomers in place of
something more appropriate. Also, all of them are useful for teaching,
which means it is instructive for tutorials to introduce them and have
people implement them themselves.
2014-12-31 20:18:02 +00:00
Mattias Lundell
292d3f5f46 ignore primitives004 on all backends except C 2014-12-30 23:29:30 +01:00
Mattias Lundell
6dafd1880a Added bit vectors to the C backend 2014-12-30 22:32:44 +01:00
Edwin Brady
d40cd6f482 Check for duplicate names in Can't Convert
Fixes #1804
2014-12-24 21:24:56 +00:00
David Raymond Christiansen
348ddce3ac Error reflection for Fin
Add reflection-based error message improvements for Fin literals. Now,
instead of a collection of internal implementation details, a friendly
and descriptive message is returned.

See test/error005 for a demo.
2014-12-22 12:41:41 -08:00
Edwin Brady
40f6534cf0 Better typecase check
Only allow matching on polymorphic arguments if they have been refined
to something concrete due to some other argument by the time they're
elaborated.
2014-12-22 11:22:42 +00:00
Edwin Brady
6c133a035a Forgot to commit the update test... 2014-12-21 01:53:43 +00:00
Edwin Brady
f733bf0e30 Only allow @ patterns on LHS
It's meaningless on the RHS and clashes with explicit instances, so
should be disallowed in the parser.
2014-12-21 01:10:06 +00:00
Edwin Brady
57cd38ae11 Fix checkPossible when unifying bound vars
It's not a rigid fail if it's two bound variables that differ.
Fixes #1108
2014-12-20 22:33:33 +00:00
Edwin Brady
87897174e5 Hide other unmatchable patterns
Lambdas, in particular. Fixes #1671
2014-12-20 22:17:03 +00:00
Edwin Brady
0d8a153cb0 New way of dealing with unmatchable patterns
Any term which is not matchable, i.e. a function application or a
repeated variable on the left hand side, is automatically put in a
PHidden. The effect of elaborating PHidden t is to:

1. Delay the elaboration of 't' to the end of elaboration
2. When elaborating t, ensure that its value is already known due to
solving some other unification problem.

If something is PHidden, but not solvable by unification, elaboration
fails.
This finally fixes #323, and probably several other things.
2014-12-20 20:52:46 +00:00
Edwin Brady
e086ccf561 Check arguments being matched on are matchable
Specifically, matching on a polymorphic argument should not be allowed
unless some other argument has determined its type.
2014-12-19 17:44:17 +00:00
Edwin Brady
6d54cb3e53 Disallow explicit types on LHS
Except under quasiquotation. This is to prevent any arguments being
specialised to a more specific type than the function type suggests (one
place where typecase can arise).
2014-12-19 13:17:13 +00:00
Edwin Brady
941ba6eacb Implemented @-patterns
By popular request. Fixes #1706.

It's not the most efficient desugaring, merely translating the @s on the
left to lets on the right, so the case tree builder won't be aware of
it. Still, it provides the notation and it works nicely with showing
what is in scope and what is available in the prover and so on.
2014-12-15 00:09:56 +00:00
Edwin Brady
7b5f4aa392 Fix visibility of imported things
Fixes #111
Previously, if a module B imports a module A, then a module C imports B,
the public names in A would also be visible to C (i.e. B would
automatically reexport everything from A). This seems to be a bad
default.

This patch changes the default behaviour so that the only names exported
from a module are those defined in that module. If B imports A and wants
to reexport everything in A, then A should be imported with the "public"
modifier (i.e. "import public A").

Several changes have been made to the prelude, since several prelude
modules were taking advantage of the old broken behaviour.

This may cause lots of things to break. Sorry. The fix is typically just
to import the module you should have imported anyway :).
2014-12-13 17:40:37 +00:00
Edwin Brady
58dd2b50d7 Move Pair/Sigma into Builtins namespace
Fixes #1775 (but there is still a related problem to address too,
being #1776)
2014-12-09 15:14:50 +00:00
Edwin Brady
c44a35c492 Merge pull request #1761 from bmsherman/dontDupErrors
Reduce redundant 'specifically' clauses in errors
2014-12-04 19:18:08 +00:00
Edwin Brady
6f032cc1b5 Merge pull request #1755 from mattias-lundell/master
Make tests work with sandboxes and fix GC statistics overflow
2014-12-04 19:17:24 +00:00
Ben Sherman
ed8198032c Update expected error messages for tests 2014-12-03 15:36:22 -05:00
David Raymond Christiansen
8ff9748188 Fix Curses whitespace issue with test delab001 2014-11-30 14:16:04 -08:00
David Raymond Christiansen
75c75975e2 Improve delaboration and pretty-printing for case
Now, the delaborator finds case expressions and converts them back to
the original. This makes :printdef work with these.
2014-11-30 13:21:38 -08:00
Mattias Lundell
3078c0bc47 Make tests work with sandboxes 2014-11-30 00:49:41 +01:00
David Raymond Christiansen
f1e161d562 A new primitive tactic for getting source locations
The tactic sourceLocation fills the hole with the current location in
the file. If such information is unavailable, it fails.

This is to be used by DSL implementers to provide useful error
messages that can't be caught at type-check time. Additionally, it may
prove useful for debugging and assertion libraries, so they can report
errors.

Because the tactic merely fills out an implicit argument in a particular
way, it doesn't break referential transparency, at least not of the core
language. This is similar to the technique used in Scala Virtualized.
2014-11-27 21:36:46 -08:00
Edwin Brady
b2017d2625 Pattern variables should be lifted to top level
...since pattern variables scope across the whole expression. If we
don't lift them, mysterious unification errors can happen for implicit
arguments.
2014-11-27 11:35:44 +00:00
Edwin Brady
e71676e025 Merge pull request #1701 from Melvar/weed-system
Weed out uses of `system`
2014-11-24 11:13:12 +00:00
Melvar Chen
78155bea70 Fix use of %flag in test basic001 2014-11-09 12:10:38 +01:00
BlackBrane
1356047c9c update test/reg050/expected [2] 2014-11-02 23:25:34 +01:00
BlackBrane
9090a46793 update test/reg050/expected 2014-11-02 22:47:16 +01:00
Edwin Brady
37b11f84af Unification fix for chains of solutions
If we have (x,y), (y,z), etc, we need to have (x,z) as the solution
instead, and sometimes this didn't happen.
Fixes #1627
2014-10-26 11:59:52 +00:00
David Raymond Christiansen
e90316a5e1 Support type errors in docstrings
Now, code blocks that are declared to be Idris code (with the Markdown
language specifier) are type checked, and any type checker or parser
errors that occur are retained and displayed to IDEs.
2014-10-18 09:09:39 -07:00
Ahmad Salim Al-Sibahi
d6981dc09b Renamed VoidElim to void in order to ensure further consistency 2014-10-11 20:52:06 +02:00
Ahmad Salim Al-Sibahi
edb9980974 Removed '_|_' as a built in declaration and renamed it to 'Void',
'FalseElim' now 'VoidElim' to match up
2014-10-11 20:00:19 +02:00
Sebastian de Bellefon
3def27931b Take basic011 out of the javascript test suite 2014-10-09 08:46:28 +02:00
Sebastian de Bellefon
8695823c00 Data.Hash library
Provides the Hashable typeclass, some instances and a regular
(non crypto) hashing function.
Some tests are provided.
2014-10-09 08:46:28 +02:00
Edwin Brady
437b9f7ac8 Disable reg052 on js backend 2014-10-08 08:36:32 +01:00
Edwin Brady
7a30e5d90b Enabled reg052 in travis and update its output 2014-10-07 17:35:11 +01:00
Edwin Brady
4694a36959 Merge pull request #1549 from fatho/fix/master/c-codegen-closing-parenthesis
Added missing parenthesis in C code generation.
2014-09-30 23:29:06 +01:00
David Christiansen
840c2cc629 Merge pull request #1556 from Helkafen/master
Allow REPL to run on another port (flag --port)
2014-09-30 17:53:36 +02:00
Sebastian de Bellefon
4fd6bc6bdf Allow REPL to run on another port (flag --port) 2014-09-27 13:54:26 +02:00
Ahmad Salim Al-Sibahi
3867dba4ec Really replaced lteZero with LTEZero 2014-09-26 18:38:51 +02:00
Ahmad Salim Al-Sibahi
562da7b7e6 Renamed 'lteSucc' and 'lteZero' in tests to 'LTESucc' and 'LTEZero' 2014-09-26 18:09:52 +02:00
Ahmad Salim Al-Sibahi
5a257a49e5 Fixed lack of renaming of lift to Lift in test 2014-09-26 16:58:28 +02:00
Ahmad Salim Al-Sibahi
b2fb9d0f20 Fixed broken provider test after providing () as Unit too 2014-09-26 14:52:27 +02:00
Ahmad Salim Al-Sibahi
17bab906e5 Fixed some accidentally wrong renamings.
Also, adapted some tests to the new names
2014-09-26 13:44:43 +02:00
Ahmad Salim Al-Sibahi
8f54aaf1b8 Fixed some tests broken under renaming 2014-09-26 07:34:38 +02:00
Ahmad Salim Al-Sibahi
fe569c4e0d Finished making standard library naming consistent 2014-09-26 07:34:38 +02:00
Ahmad Salim Al-Sibahi
6faa1ab210 Renaming of built-in datatypes works finally 2014-09-26 07:34:29 +02:00
Ahmad Salim Al-Sibahi
f0ed9e992f First renaming attempt 2014-09-26 07:34:28 +02:00
Fabian Thorand
10662e8a70 Added regression test for bug in C code generation. 2014-09-25 00:03:37 +02:00
David Raymond Christiansen
c629b605b1 Add a test for compiler filename warnings 2014-09-24 10:56:28 +02:00
Markus Pfeiffer
6359721128 Add test for new float primitive prim__negFloat 2014-09-22 11:56:03 +01:00
Michael Maloney
e0f815ae32 Add test for basic REPL commands 2014-09-03 20:24:34 -05:00
Edwin Brady
b591600d12 Don't propagate unique names to 'where'
Doing so breaks typechecking, leading to nothing working any more...
passing them to lifted 'where' definitions counts as a use in the
typechecker, so *any* where clause will fail to typecheck.

This is an effect of how 'where' clauses are elaborated, and is probably
not the best behaviour (though it is better than the default which rules
our where clauses completely) so we should revisit it later if
uniqueness typing turns out to work effectively.
2014-08-26 09:25:10 +01:00
Edwin Brady
d2f95b0d1d Really fix output of unique001a... 2014-08-22 21:09:16 +01:00
Edwin Brady
773ff9a825 Fix output of unique001a 2014-08-22 20:34:54 +01:00
Edwin Brady
c55895d705 Fix universe errors, update tests 2014-08-22 20:31:11 +01:00
Edwin Brady
7e7368dab2 Store kind in Pi binders
We need to know the kind for properly checking uniqueness under partial
application. Also, we need to propagate uniqueness right into the scope
of a binding - once we're in a unique context, any function we make has
to run in unique context or we might accidentally duplicate things.
2014-08-22 19:58:59 +01:00
Edwin Brady
120b1c3286 Add unique002 test 2014-08-22 01:36:22 +01:00
Edwin Brady
ddf9779f87 Fix borrowed type check
Actually a borrowed type can be used as many times as you like, it's
just the names inside the pattern that can't be used without being lent
first!
2014-08-22 00:12:58 +01:00
Edwin Brady
b37dcbeab3 Add missing test 2014-08-21 23:09:53 +01:00
Edwin Brady
bc2bcb65ca Add Borrowed types
This allows unique values to be inspected, but not updated or
destroyed. A 'Borrowed' value can be pattern matched, but cannot be used
on the right hand side, nor can any Unique values contained in the
pattern.
2014-08-21 22:38:58 +01:00
Edwin Brady
8fd681362e Disable primitives003 test in LLVM back end
There is apparently a bug which causes it to segfault - I don't know if
this is an llvm bug or an idris llvm code generator bug, but I don't
want this to get in the way of further uniqueness type development.
2014-08-20 12:03:09 +01:00
Edwin Brady
a1fb7a3144 Inline with blocks 2014-08-19 16:21:00 +01:00
Edwin Brady
86bf04c7cf Truncate results in primitives002 test
Precision varies, and since the test is meant to check the primitives
are implementing what they're supposed to, truncation is okay. This
stops the test failing on 64 bit machines.
2014-08-09 14:08:15 +01:00
Edwin Brady
ddced5cd62 Store parameters in function types
Need this so that parameters are properly propagated into definitions
where necessary, and not propagated otherwise.
2014-08-08 13:06:03 +01:00
Edwin Brady
42c694ced4 More efficiency improvements
More efforts to avoid allocation where no updates happen.
2014-08-06 18:25:01 +01:00
David Raymond Christiansen
40d07c4c2a Merge remote-tracking branch 'refs/remotes/upstream/master' into issue/1318
Conflicts:
	CHANGELOG
2014-08-05 09:51:27 +02:00
Edwin Brady
ab36099493 Use a zipper-like proof state
Proof state now contains the term in focus, its environment, and a path
through the complete term to reach that sub-term. As a result, large
proof terms are now checked more quickly

Cleaned up a couple of other things on the way...
2014-08-03 21:14:50 +01:00
Melvar Chen
5d25ac8211 Add regression test for operators starting with "!" 2014-07-30 00:47:17 +02:00
David Raymond Christiansen
816e85b92c Reinsert check for constructor/family mismatch.
It appears that the code to do this was accidentally deleted at some
point. It is now called again.

Fixes #1434.
2014-07-28 20:36:47 +02:00
David Raymond Christiansen
0337afe7cb Make proof arguments to list functions implicit
This makes code much cleaner.  Fixes #1318.
2014-07-25 00:24:30 +02:00
David Raymond Christiansen
84b172a4e6 Add tactics "skip" and "fail"
"skip" does nothing, while "fail" produces an error. They have
corresponding reflected versions Skip and Fail. Fail has access to the
pretty printer by taking a List ErrorReportPart as its argument.
2014-07-24 23:26:52 +02:00
David Christiansen
eedaa56fbf Merge pull request #1406 from jthemphill/fix-qsort
Fix a bug in qsort
2014-07-19 23:46:31 +02:00
Ahmad Salim Al-Sibahi
927cca70a6 Fixed bug regarding insertion in SortedMap.
Fixes idris-lang/Idris-dev#1394. Solution based on the diagnosis in @sebzim4500s comment.
2014-07-19 20:34:12 +02:00
Jeff Hemphill
1275b9e8cc Fix a bug in qsort
Try `qsort [3,3]`. Under the old code, you'd get `[3,3,3]` out.
2014-07-18 00:58:54 -07:00
Edwin Brady
86ec4a1d58 New regression test 2014-07-16 21:05:14 +02:00
Edwin Brady
734a7bf52f Generate better record projection types
In particular, pay attention to parameters since there is no need to
project in the type for these.

Fixes #201
Fixes #1356
2014-07-16 14:02:37 +02:00
Edwin Brady
9000ecf5aa Spot name clases in error messages
This just renames the internal name to something distinguishable. It's
still not completely clear (since it's a renaming from the user's name)
but given that the message means a user has picked the same name twice,
there's not too much else we can do easily... Certainly it's better than
"Can't unify f x with f x"...

Fixes #705
2014-07-16 13:17:37 +02:00
Edwin Brady
ced7733b76 Replace 'effects' with neweffects 2014-07-15 21:35:35 +02:00
David Raymond Christiansen
9cd2dfb9b3 Update tests for rechecking of quasiquotes 2014-07-14 11:18:24 +02:00
Edwin Brady
8ed343ba6a Remove dodgy unification hack
Also need to recheck unification problems immediately after setting
injective arguments, or we get strange results for disambiguation.
Fixes #1372
2014-07-11 14:26:30 +01:00
Edwin Brady
1269791525 Keep type arguments of = when unelaborating
This allows more informative error messages when the mismatch is in the
type arguments to =.
2014-07-09 21:15:06 +01:00
Edwin Brady
e363c092a2 Better treatment of unbound implicits
Now uses the elaborator to generate any necessary extra bindings, using
the same machinery as pattern match elaboration. The end result is that
you no longer need 'using' in a lot of cases (it is still useful if you
want to give explicit types, of course). e.g. this now works as it
stands:

  data Elem : a -> Vect n a -> Type where
       Here : Elem x (x :: xs)
       There : Elem x xs -> Elem x (y :: xs)

  isElem : DecEq a => (x : a) -> (xs : _) -> Maybe (Elem x xs)

This should also reduce the number of weird "no such variable" errors
signfificantly. In particular, it fixes #1354
2014-07-08 02:40:37 +01:00
David Raymond Christiansen
dac312b626 Add goal types to quasiquotes.
A quasiquote expression can be given a goal type for the elaborator,
which helps with disambiguation. For instance, `(() : ()) quotes the
unit constructor, while `(() : Type) quotes the unit type.  Both goal
types and quasiquote are typechecked in the global environment.
2014-06-30 18:49:22 +02:00
David Raymond Christiansen
9a3082ba32 Add simple test for quasiquotations 2014-06-25 23:58:39 +02:00
Edwin Brady
35b22b9eb8 Remove unnecessary test 2014-06-10 19:55:11 +01:00
Edwin Brady
1100e9b0d3 Remove reg008
Functions its testing is now part of the library
2014-06-10 19:19:30 +01:00
David Raymond Christiansen
9993f3bd80 Add pi to overridable syntax in DSL blocks 2014-06-09 23:39:00 +02:00
Edwin Brady
2b183c8e27 Merge pull request #1294 from JanBessai/JavaBackendFixes
Java back-end fixes
2014-06-09 12:51:35 -07:00
Edwin Brady
42dcbc3d54 Deal with 'Delay' in case building properly
We mustn't inspect the laziness type, because we'll never have it. (This
is a bit of a hack and relies on never having two different types of
laziness in the same argument, but since that doesn't make sense anyway,
I believe this is safe!)

Fixes #1295
2014-06-09 20:48:03 +01:00
Jan Bessai
71fae2801f fix missing tests 2014-06-07 22:01:16 +02:00
Jan Bessai
4aadf4ca0d Merge branch 'master' into JavaBackendFixes
Conflicts:
	test/reg029/run
2014-06-07 17:26:10 +02:00
Edwin Brady
9c59a193e2 Merge branch 'master' of github.com:idris-lang/Idris-dev 2014-06-05 15:08:04 -07:00
Edwin Brady
921b766c2d Fix name propagation in error messages
Fixes #1225
2014-06-05 15:07:35 -07:00
David Raymond Christiansen
e5bc47eec3 Distinguish postulate providers and type providers at use site
This is not backwards compatible, but as far as I know, there are no
users of postulate providers who are not me.

The old system allowed both the definition of the provider and the use
site to be involved in the determination of what is a postulate and what
is not. This is not good - users should always be in full control of
this.

The new implementation has two syntaxes:

%provide (x : t) with p

%provide postulate x with p

The first is the type provider syntax we know and love. The second
requires that the provider in fact return a type, which is then made
into the type of the resulting postulate.
2014-06-05 13:53:03 +02:00
Edwin Brady
3b37daf85f Merge pull request #1265 from ziman/dependent-pairs
Split dependent pairs
2014-06-04 16:47:58 -07:00
Melvar Chen
d30a1eaa3f Add Prelude.Vect.transpose
Test adjusted due to name clash.
2014-05-30 16:44:14 +02:00
Matus Tejiscak
7868829be4 Fix reg030. 2014-05-29 15:44:00 +01:00
Matus Tejiscak
2ffd9e4b5a Add a timeout. 2014-05-29 13:55:04 +01:00
Matus Tejiscak
c848c298ee Implement basic010 properly. 2014-05-29 13:40:08 +01:00
Edwin Brady
5aa2a8e215 Find negative occurrences in positivity checker
We were only looking in higher order arguments, not in polymorphic
arguments, so missed a few.

Fixes #474
2014-05-28 23:27:12 +02:00
Matus Tejiscak
b8d355cb32 Implement basic010. 2014-05-28 18:05:57 +01:00
Matus Tejiscak
b9781fbd09 Make evidence witness explicit. 2014-05-28 17:21:10 +01:00
Matus Tejiscak
f13c6ad462 Add test, create the DepPair typeclass. 2014-05-28 17:10:44 +01:00
Matus Tejiscak
5c9ffda026 Fix dependent pair names in reg030. 2014-05-28 15:57:36 +01:00
Edwin Brady
e7a35e93e0 Remove implicit qualifier for 'effect'
Two reasons:

1. The most important: it makes error messages *so much better* :).
Because "effect'" rarely properly fails due to having a very generic
type, so any error arises later and breaks the real error which came
from lift'
2. It is much easier to explain what's going on when documenting
effects!

Apologies for breaking effectful code: I now think it is much better
this way though.
2014-05-25 17:05:27 +02:00
Edwin Brady
2d22462fd8 Check that proof steps introduce no new problems
In interactive mode only (it is important that proofs can fail
temporarily during elaboration since futher information may help refine
the goal).

Fixes #1243
2014-05-22 12:14:51 +01:00
David Christiansen
8b55229e49 Merge pull request #1222 from klrr/split-bins
#897 optparse-applicative command line parser
2014-05-20 15:22:28 +02:00
klrr
9be5866a80 started working on new cmd arg parser
continued the work on getting the parser to work

works now, still work to do though

done with the parser, removed reduntant code, added metavars

maybe fixes build error...

changed test that used --exec without arg, and added warnreach which i forgot

removed out-commented code, added last metavar
2014-05-14 18:39:47 +02:00
Edwin Brady
f53580afbd Change type class top level method generation
Don't put explicit arguments in the top level methods (i.e. make them
point free). This means that they will be more inclined to reduce, which
helps in particular with totality checking, but possibly also with
theorem proving.
2014-05-13 00:34:11 +01:00
David Raymond Christiansen
8d0796788f Stop building packages if there are totality mismatches
This is to stop libraries from preventing executables to build later.
2014-05-09 20:48:41 +02:00
Edwin Brady
e1f75976f5 Merge pull request #1204 from david-christiansen/totality-warning
Make totality a warning until compiling
2014-05-08 17:17:15 +02:00
David Raymond Christiansen
755b5b32a2 Remove stale .ibcs 2014-05-07 10:54:07 +02:00
David Raymond Christiansen
7f9526c595 Update test for totality warnings
Now, all totality problems are shown. Update test accordingly.
2014-05-06 19:57:31 +02:00
David Raymond Christiansen
cd8a233855 Don't try to compile a test that doesn't have main
Instead, just --check it.
2014-05-06 19:55:20 +02:00
David Raymond Christiansen
0cdef7fc1f Update for totality warnings
Now, totality discrepancies prevent compilation. Add partial annotations
to totality005 to make it compile.
2014-05-06 19:50:32 +02:00
David Raymond Christiansen
a6caf2d399 Show more errors
The totality warnings mean that elaboration doesn't stop when it sees a
totality issue. Allow both issues to be reported in this test.
2014-05-06 19:45:37 +02:00
David Raymond Christiansen
624d6c7126 Fix precedence of application vs arrows in pprint
Changes
    Prelude.Applicative.<$> : Applicative f => (f (a -> b)) -> (f a) -> f b
into
    Prelude.Applicative.<$> : Applicative f => f (a -> b) -> f a -> f b
2014-05-04 19:43:12 +02:00
Edwin Brady
ac617c15bb Replace records003 test
Oops, wasn't up to date!
2014-05-04 13:27:53 +01:00
Edwin Brady
58774fed6b Merge branch 'master' of github.com:idris-lang/Idris-dev 2014-05-04 12:46:35 +01:00