Commit Graph

808 Commits

Author SHA1 Message Date
David Raymond Christiansen
dc4d3e11a4 Test update 2015-06-03 18:17:21 +02:00
David Raymond Christiansen
02a8a087f0 Merge remote-tracking branch 'refs/remotes/upstream/master' into issue/2322
Conflicts:
	src/Idris/Delaborate.hs
	test/error004/expected
2015-06-03 13:09:18 +02:00
David Raymond Christiansen
38123a426e Resugaring for do and fromInteger 2015-06-03 13:04:47 +02:00
Edwin Brady
85a9d5063c Update error messages in tests 2015-05-31 21:22:36 +01:00
Edwin Brady
61870cb9b2 Change wording in unification errors
"Can't unify" and "Can't convert" are terrible error messages for
programmers, and particularly confusing to explain to beginners, because
programmers don't need to know that implementation detail.

Changed to "type mismatch" and updated docs accordingly.
2015-05-24 23:23:20 +01:00
David Christiansen
3dff1b5fc7 Merge pull request #2305 from Melvar/showprec
Add showPrec to Show
2015-05-23 16:15:42 +02:00
Niklas Larsson
7f51692166 Don't include the executable in the output.
It is different on Windows (not only .exe, it's the whole path
so it's impossible to predict).
2015-05-22 18:50:50 +02:00
Melvar Chen
1fec4fa74c Add showPrec to Show 2015-05-22 18:09:31 +02:00
David Raymond Christiansen
9d295be047 Fix dictionary arguments in dependent type class methods
Type class methods references were previously elaborated using the
ordinary function call elaboration, but their class isn't yet available
when the method lookup function is elaborated. This leads to a "can't
resolve type class" error on the type class definition.

Now, they have an explicit dictionary argument inserted, pointing at the
dictionary that's used for the type of the method whose signature they
appear in.

Fixes #2302.
2015-05-20 11:23:03 +02:00
David Christiansen
9174cf375b Merge pull request #2297 from david-christiansen/reflection-improvements
Fix a few reflection helpers
2015-05-19 18:09:43 +02:00
David Raymond Christiansen
9917c9e549 Add more Show 2015-05-19 16:04:53 +02:00
David Christiansen
cfb101657a Merge pull request #2293 from david-christiansen/total-output
Fix display of output from :total
2015-05-18 19:23:27 +02:00
David Raymond Christiansen
0696537cc2 Fix display of output from :total
Now, the pretty-printer is used, which makes it look non-horrible in IDE
clients as well as get semantic highlighting.
2015-05-18 16:29:11 +02:00
Edwin Brady
dcc3942b3c Disable disambig001 test for js
Since it doesn't have getArgs available (and it's tested adequately by
the other backend tests)
2015-05-18 12:31:01 +01:00
Edwin Brady
5b73dcbde1 Fix the broken 'Exact' versions of lookups
Instead of checking there's exactly one result, they must check that one
of the (possibly many) results is the exact name they were looking for,
since some things may be unqualified and will be returned anyway.

Fixes #2271 (again; test for disambig001 and disambig002 added)
2015-05-18 10:33:33 +01:00
Edwin Brady
0819777c73 Improved type-directed disambiguation
If disambiguation fails, then instead of reporting an error immediately,
defer the elaboration until later. Fixes #2285.

In the process, PAlternative now has a more descriptive argument than
merely a Bool to say whether it's a proof search, or a disambiguation,
and whether it's allowed to be delayed or not. IBCs need rebuilding.
2015-05-17 16:27:38 +01:00
Edwin Brady
3034fb619c Remove argument ordering hack in elaborator
This used to be needed because the elaborator wasn't good at going back
and patching up things that didn't work right, but now it just gets in
the way and causes all sorts of other problems. This tidies up
elaboration/unification a bit more.
2015-05-17 00:46:16 +01:00
Edwin Brady
f8cb234577 Reading from a file shouldn't strip \n
We need to get exactly what's in the file or strange things might happen
and assumptions get broken.
Change getLine to strip newlines itself rather than have the RTS do it,
for consistency with the REPL behaviour.
2015-05-16 14:03:13 +01:00
David Raymond Christiansen
56e83556f1 Fix elaboration of "with ... proof ..." clauses 2015-05-12 13:04:17 +02:00
David Raymond Christiansen
7e8e25bde8 Merge branch 'master' into name-highlights
Conflicts:
	src/Idris/AbsSyntax.hs
	src/Idris/AbsSyntaxTree.hs
	src/Idris/Delaborate.hs
	src/Idris/Elab/Term.hs
	src/Idris/ParseExpr.hs
2015-05-12 10:22:07 +02:00
Melvar Chen
53e12818be Remove PEq 2015-05-11 02:38:08 +02:00
David Raymond Christiansen
73b666be0f Merge remote-tracking branch 'refs/remotes/upstream/master' into name-highlights
Conflicts:
	src/Idris/Elab/Class.hs
	src/Idris/Elab/Term.hs
	src/Idris/ParseData.hs
	src/Idris/Parser.hs
2015-05-11 02:11:11 +02:00
David Raymond Christiansen
95d90f4d35 Better highlighting for data declarations 2015-05-11 01:41:23 +02:00
Melvar Chen
8984d49cd7 Remove PRefl and all references to it 2015-05-11 00:41:09 +02:00
David Christiansen
dc69794cf6 Merge pull request #2245 from ahmadsalim/bug/fixequalityplicity
Removed equality from primNames, as it shouldn't be handle specially when adding implicits (the only current use).
2015-05-10 22:55:41 +02:00
Ahmad Salim Al-Sibahi
0cae95a59f Removed equality from primNames, as it shouldn't be handle specially when adding implicits (the only current use). 2015-05-10 18:20:44 +02:00
Edwin Brady
74fd10acf4 Fix 'impossible' check
It should never reject recoverable unification errors as impossible.
This fixes the eta is inconsistent "proof".
2015-05-09 19:15:49 +01:00
Edwin Brady
cbb86b2de1 Fix missing check on case in types
It's only a type to be inferred if there are metavariables left over.
Even then, the solved type needs to be rechecked.
Also fix the Hangman test which shouldn't have compiled.
Fixes #2196
2015-05-09 15:26:00 +01:00
Edwin Brady
23b36dabbb Remove mysterious files in test/basic001 2015-05-08 18:08:57 +01:00
David Raymond Christiansen
12bcfe4296 Allow type classes to have explicitly-named instance constructors 2015-05-08 12:30:00 +02:00
David Raymond Christiansen
c538c346cd Merge remote-tracking branch 'refs/remotes/upstream/master' into agda-style-records
Conflicts:
	src/Idris/ParseHelpers.hs
2015-05-06 18:25:43 +02:00
David Raymond Christiansen
90127b39c4 High-level if ... then ... else ... expression
Now, conditionals are implemented by the compiler rather than a
library. This gives better error messages and more readable output, at
the cost of more Haskell and less Idris.

Also, boolElim is renamed to ifThenElse for consistency with other
languages that support overloading of conditional expressions (GHC
Haskell and scala-virtualized) and to reflect that things other than
Booleans will be eliminated by overloadings.
2015-05-06 15:44:02 +02:00
David Raymond Christiansen
274b6b1366 Fix test bitrot 2015-05-05 21:04:06 +02:00
David Raymond Christiansen
c1cd201572 Merge remote-tracking branch 'refs/remotes/upstream/master' into agda-style-records
Conflicts:
	src/Idris/AbsSyntaxTree.hs
	src/Idris/Elab/Record.hs
2015-05-05 20:36:51 +02:00
Markus Pfeiffer
0aa5d53271 Remove buffer test 2015-05-05 00:23:38 +01:00
David Raymond Christiansen
f09605b3dd Require unique global names in TT
Fixes #2217 by demanding that global names in TT terms be
unambiguous. The elaborator will always produce them that way, but user
elab scripts might not, which led to confusion.

Also, disentagle 'apply' and 'fill'.
2015-04-30 12:40:36 +02:00
David Raymond Christiansen
8ab1ac6c29 Richer universe error objects
Now, they are reported using the standard infrastructure.
2015-04-28 12:01:41 +02:00
Edwin Brady
d1941f50d3 Fix bug with Type*/AnyType in data decls
(Type* now deprecated and replaced with AnyType). If an AnyType is a
parameter of a type, the type itself must be an AnyType otherwise we
might be able to duplicate a unique thing by mistake.
2015-04-26 14:41:55 +02:00
David Raymond Christiansen
28e2668206 Add reasonable tests for elaborator reflection 2015-04-23 23:18:44 +02:00
David Raymond Christiansen
4b7c132dfb Test update for data def/mutual block fix 2015-04-22 22:37:18 +02:00
David Raymond Christiansen
83c2728cab Update test for changed mutual block and datatype behavior 2015-04-22 17:17:23 +02:00
David Raymond Christiansen
d6458bb2df Add `{n} for quotations of the global name n 2015-04-22 16:19:55 +02:00
David Raymond Christiansen
6f30060ede Don't look for the parameters of bound variables.
Fixes #2130.
2015-04-20 11:41:56 +02:00
identical snowflake
387046aa4b added test for divNat optimization 2015-04-18 00:29:55 +03:00
Niklas Larsson
c308d09f4a Delete folding002 test.
It tested for tailcalls that have been removed.
2015-04-16 21:21:09 +02:00
Edwin Brady
5269289f13 folding002 isn't really appropriate now
Since the library definition of List was simplified to be not tail
recursive in #2088
2015-04-16 11:39:05 +01:00
David Christiansen
1dfbb72954 Merge pull request #2149 from david-christiansen/wip/tactical
Integrate ongoing work on elaborator reflection
2015-04-15 13:42:50 +02:00
David Raymond Christiansen
6c7c8870b2 Update indentation in test 2015-04-15 12:15:56 +02:00
Edwin Brady
3a43ccc488 Merge pull request #2108 from Heather/sandbox_path
runtest.pl : fix error when there is no sandbox
2015-04-14 20:12:10 +01:00
Edwin Brady
f6414691de Merge pull request #2143 from soimort/getLine-inconsistency
Fix getLine inconsistency
2015-04-14 20:10:50 +01:00
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