Commit Graph

197 Commits

Author SHA1 Message Date
Edwin Brady
abd801c45a
Merge pull request #177 from SPY/testfix/chez010-macos
Fix chez010 test on MacOS
2020-01-11 22:50:16 +00:00
Edwin Brady
da293d1ce8 Check constructors are fully applied in case trees
This is necessary to build case trees correctly, and without this, we
can get mysterious and hard to debug run time errors!
2020-01-11 17:27:27 +00:00
Ilya Rezvov
32b1c9b34f use an explicit extension for libcb references in %foreign pragmas 2020-01-09 11:55:33 -08:00
Ilya Rezvov
56d24e34d4 Merge remote-tracking branch 'origin/master' into testfix/chez010-macos 2020-01-09 11:44:51 -08:00
Edwin Brady
7cde0a7255
Merge pull request #174 from chrrasmussen/fix-double-subtraction
Fix subtraction of Double in interpreter
2020-01-09 11:41:40 +00:00
Edwin Brady
4b79b98db4
Merge pull request #173 from timmyjose/fix-mit-scheme-build-issues
Reorder Scheme compilers order to pick generic Scheme last.
2020-01-09 11:39:39 +00:00
Ilya Rezvov
b437323fd2 dylib extension added for libcb to fix chez010 test on MacOS 2020-01-01 14:23:02 -08:00
Edwin Brady
bf5b2298e0 Update test chez010
To use expressions to calculate FFI convention, so that it's tested.
2019-12-30 21:16:07 +00:00
Edwin Brady
df3f8b73f8 Further tweak to linearity rules
When we check a scope in RigW, need to mark all linear things outside
that scope as irrelevant within the scope (since the scope may be used
multiple times).
2019-12-29 15:21:08 +00:00
Christian Rasmussen
a70c68da91 Add test for Double subtraction 2019-12-22 21:50:18 +01:00
Timmy Jose
1c1e2b16ca Reorder Scheme compilers order to pick Chez Scheme first.
This fixes the issue where some Scheme compiler like mit-scheme is
installed and that gets picked up first, leading to an infinite
loop in the tests.

Also see attached image in the PR.
2019-12-21 18:42:09 +05:30
Edwin Brady
663e1b8f69 Add uniqueSearch data type option
This changes the behaviour of 'auto' implicits so that by default they
return the first result, rather than checking for unique results. This
is consistent with Idris 1. However, we still want to check for
uniqueness somtimes (for example, with interface search, which should
reject overlapping results) so the 'uniqueSearch' option means that any
auto implicit search for the type should check uniqueness of results.

Fixes #169
2019-12-07 18:54:02 +00:00
Edwin Brady
79320c1574
Merge pull request #145 from lodi/nixprep
allow overriding racket/chicken paths through environment variables
2019-12-06 10:40:32 +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
lodi
76ff99d370 allow overriding racket/chicken paths through environment variables
This is to help Idris2 codegen the correct scripts on NixOS where
Racket and Chicken aren't installed in the standard locations, and
the /usr/bin/env trampoline is disabled at package build time.
This now matches the existing Chez behavior.

Also, fixed the test runner to restore the correct working directory
after a failed test, and fixed the top-level Makefile to allow the
IDRIS2_VERSION variable to be queried without building the project.
2019-10-28 22:44:16 -04: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
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
Ohad Kammar
90927cd886 Add multiple parameter block to test suite 2019-10-24 00:06:57 +03: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
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
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
Arnaud Bailly
eedbf23f38 allow matching constants in with clauses fix #122 2019-10-15 21:52:44 +02: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
Edwin Brady
d9ff8d65a6 Allow implementations to have implicits given
See e.g. Applicative instance in Data.Vect. This allows implementations
to use implicits at run time (by default, they'd be 0 multiplicity so
erased, but it might be useful to have an index available at run time).

At the moment, the parser requires implicits to be given before
constraints. Ideally it should be possible to give them in any order.
I'll come back to this.
2019-10-13 12:32:07 +01:00
Edwin Brady
85459814ef Support foreign callbacks in Racket back end 2019-09-29 19:37:30 +01:00
Edwin Brady
c6039e4fe5 Support callbacks in foreign calls to C
Currently Chez backend only
2019-09-29 17:25:26 +01:00
Edwin Brady
78e44a4353 Reading/writing buffers can fail
So, make them return and Either and wrap the scheme definitions in an
exception handler that returns an error code on failure
2019-09-28 18:33:46 +01:00
Edwin Brady
1a4f424259 Support UTF8 strings
When writing to ttc, need to take the length in bytes rather than the
length in characters. Also need to write to scheme in the appropriate
format for each scheme system.

While we're at it, Idris 1 supports unicode identifiers (although we
don't encourage it :)) so this allows any characeter >127 in an
identifier.
2019-09-28 14:08:23 +01:00
Kamil Shakirov
0722b96fef Add '--no-banner' option 2019-09-24 20:26:25 +06:00
Arnaud Bailly
2f8daa7cf2 Merge branch 'master' of https://github.com/edwinb/Idris2 into add-version-command 2019-09-22 22:39:36 +02:00
Edwin Brady
728ef085a5 Write out less metadata
For the types of local names, don't write out the environment - it's
going to be repeated for every name, mostly it's unhelpful, and if you
want to see the types of other names you can ask directly. This can save
a huge amount of time when environments are slightly complicated.
2019-09-22 18:01:29 +01:00
Arnaud Bailly
9c1f8b6f02
Merge branch 'master' into add-version-command 2019-09-22 15:50:13 +02:00
Edwin Brady
7825d216c0 Push constraint name into default method impls
If a default method implementation refers to another method in the
interface, it's going to be one from the interface being defined, so
push it through explicitly.
This is only going to be guaranteed to be the case for default method
implementations - we can't assume anything for other implementations.
Fixes #77
2019-09-20 19:01:07 +01:00
Edwin Brady
9b639eee35 Nat optimisation needs to look under lambda
Names are saturated, so there might be a lambda in the term we're
optimising. Fixes #62
2019-09-18 10:00:30 +01:00
Arnaud Bailly
295058130e
Merge branch 'master' into add-version-command 2019-09-13 17:33:14 +02:00
Edwin Brady
253a34dee6 Merge branch 'master' of github.com:edwinb/Idris2 2019-09-13 13:19:35 +01:00
Edwin Brady
4159d43432
Merge pull request #75 from abailly/configurable-ide-mode-socket
Configurable ide-mode-socket REPL
2019-09-13 13:13:02 +01:00
Edwin Brady
421b15aa24 Detect cycles in imports 2019-09-07 14:54:29 +01:00
Edwin Brady
65db4fbf96 Put built ttcs in build/ttc, rather than build
This is so that we can put other build artefacts (e.g. executables) in
properly organised subdirectories of build, e.g. build/bin/chez,
build/bin/js, etc.
2019-09-04 12:41:16 +01:00
Arnaud Bailly
3dcd48e08b
Merge branch 'master' into configurable-ide-mode-socket 2019-08-29 16:24:17 +02:00
Arnaud Bailly
643fc9c4c7
provide Version command in ide-mode 2019-08-29 14:37:38 +02:00
Arnaud Bailly
558776c4c4
remove version number from banner at REPL startup
otherwise all tests will need to change every time version changes...
2019-08-29 14:37:04 +02:00
Arnaud Bailly
4646bb0d1c
expose current Idris2 version as a proper type 2019-08-29 14:37:04 +02:00
Edwin Brady
0a8b50d31f
Merge pull request #72 from jfdm/make-test-output-better
Print expected and given output when test fails.
2019-08-29 10:52:30 +01:00
Edwin Brady
718f5963ce
Merge pull request #70 from jfdm/expand-ipkg-contents
Align the IPKG format more with the previous Idris implementation.
2019-08-29 10:51:41 +01:00
Arnaud Bailly
64b0c10356
Merge branch 'master' of https://github.com/edwinb/Idris2 into configurable-ide-mode-socket 2019-08-17 12:56:38 +02:00
Edwin Brady
c01986a62e Preserve order of arguments in unification
Sometimes we swap the arguments, to reduce code duplication, but we need
to remember we've done that since (1 x : a) -> b is valid for an
argument of type (x : a) -> b, but not vice versa (that is, we have a
teensy bit of subtying to deal with, for convenience...).

This fix seems a bit ugly, but we do at least now propagate the
information. Fixes #82.
2019-08-16 11:32:16 +01:00