Commit Graph

334 Commits

Author SHA1 Message Date
Edwin Brady
6fcf861bc1 Change argument unification order
Solving later arguments first means that they can refer to solutions of
earlier arguments. This isn't really the best solution for ensuring that
metavariables refer to things defined earlier, but it helps, and it does
fix #304.
2020-04-28 11:31:18 +01:00
Matus Tejiscak
82a23afae7 Add compatibility with the original record update syntax. 2020-04-27 18:02:25 +02:00
Edwin Brady
2fd1c40056
Merge pull request #314 from MarcelineVQ/using-fix
'using' multiple named instances in scope fix
2020-04-27 15:16:12 +01:00
Edwin Brady
c75af6d116 Update test output 2020-04-27 14:45:06 +01:00
Edwin Brady
e208ea7129
Merge pull request #298 from ziman/records
RFC: Dot syntax for records
2020-04-27 14:28:19 +01:00
Edwin Brady
c95c4c6c0c
Merge branch 'master' into prelude-inline-doc 2020-04-27 13:38:29 +01:00
Edwin Brady
1262ca2fde
Merge branch 'master' into records 2020-04-27 13:36:18 +01:00
Edwin Brady
b9907fbb21
Merge pull request #254 from jfdm/literate-modes
Enhance literate mode to recognise multi-modes.
2020-04-27 13:33:55 +01:00
Edwin Brady
ff86f6f834 Implement occurs check properly (finally!)
Instead of the previous unreliable hack, actually look for occurrences
of the solved metavariable. Block if there are any, and fail if there
are any under a constructor. I had expected this to hurt performance
quite a bit, but it seems it doesn't.
This was prompted by #304, which is now partly fixed, but there's still
a refinement to unification needed to fix it fully (and at least it
doesn't segfault due to the cycle now!)
2020-04-27 12:17:45 +01:00
Edwin Brady
4947a9981a Fix lambda multiplicity check
A bug found via the very handy, but occasionally bad for performance so
off by default, --debug-elab-check. The multiplicity of a lambda type
needs to be checked against the expected multiplicity, not the given
multiplicity. Oops!

If you have any (\0 x => e) or similar, you may find you need to fix a
type error after this update...
2020-04-24 22:28:52 +01:00
Matus Tejiscak
07bb57d3a1 Stop using :exec in record004. 2020-04-24 19:14:22 +02:00
Matus Tejiscak
4baa09a7de Sidestep the question of printing floats. 2020-04-24 19:10:23 +02:00
Edwin Brady
819c9d7af1 Evaluate primitives (fromInteger etc)
At least as long as the number is small enough (currently set to < 100).
This is because it can open up further evaluation opportunities when
typechecking, and can make the term we're working with smaller - it also
makes display a bit neater.
Overall this makes some pathological cases of terrible performance much
better, without hurting anything else.
2020-04-23 21:21:08 +01:00
MarcelineVQ
896cd486d1 update 'using' regression test
have implementation 'using' regression test also check for multiple named implementations
2020-04-22 16:53:02 -07:00
Jan de Muijnck-Hughes
e091ca5701
Update tests/idris2/literate012/expected
Co-Authored-By: G. Allais <guillaume.allais@ens-lyon.org>
2020-04-22 20:37:07 +01:00
Kamil Shakirov
1d2250062b Fix tests 2020-04-22 11:56:08 +06:00
Matus Tejiscak
f44d384d63 Fix tests. 2020-04-21 23:47:34 +02:00
Matus Tejiscak
934cb29a80 Fix paths in record004. 2020-04-21 23:45:55 +02:00
Matus Tejiscak
e49364ff56 Merge branch 'master' into records 2020-04-21 23:11:40 +02:00
Matus Tejiscak
cb02395acb Rename record003 to record004. 2020-04-21 22:56:20 +02:00
Jan de Muijnck-Hughes
af27bce2e2 Enhance literate mode to recognise multi-modes.
While Bird Style literate mode is useful, it does not lend itself well
to more modern markdown-like notations such as Org-Mode and CommonMark.

This commit extends Idris2's existing literate mode to recognise both
'visible' and 'invisible' code blocks and lines in predefined markdown
styles.

The styles and their elements are:

+ Bird Style :: `>` denotes a visible code line, `<` a hidden code
                line.

+ OrgMode :: Org Mode source blocks for idris are recognised as
             visible code blocks, and comment blocks are invisible
             code blocks. Invisible code lines are denoted with
             `#+IDRIS:`.

+ CommonMark :: Only code blocks denoted by standard code blocks
                labelled as idris are recognised.

For backwards compatibility, we recognise literate modes by file
extension:

+ Bird Style :: `.lidr`
+ OrgMode :: `.org`
+ CommonMark :: `.md`

In future we should add support for literate `LaTeX` files, and more
intelligent processing of literate documents using a pandoc like
library in Idris such as: [Edda](https://github.com/jfdm/edda).
2020-04-21 19:27:46 +01:00
Christian Rasmussen
2a3213d10a
Merge branch 'master' into fix-chez-in-folder-with-spaces 2020-04-21 15:01:01 +02:00
Edwin Brady
2b6000ecac Shuffle some tests around
Making sure that tests which use chez are run after we've checked chez
is installed
2020-04-21 12:03:49 +01:00
Edwin Brady
2ad1621a3e Regression test for using named implementations 2020-04-21 11:51:44 +01:00
Edwin Brady
71cae356e2
Merge pull request #281 from ziman/fix-cast-double-int
Fix cast to integral types
2020-04-21 11:24:09 +01:00
Edwin Brady
627d2c2f2b
Merge pull request #292 from ohad/fully-abstract-records
Fully abstract records
2020-04-21 10:59:51 +01:00
Edwin Brady
afa90c6ddc
Merge pull request #284 from abailly/integral-operations
use quotient on scheme backends
2020-04-21 10:51:18 +01:00
Edwin Brady
8a0063a016
Merge pull request #280 from gallais/comments
[ fix #279 ] comment delimiters with more than one dash
2020-04-21 10:49:24 +01:00
Edwin Brady
1734841275 Add a lambda lifter
It's not actually used as part of any compilation pipeline yet, and I've
only tested it by eyeballing the output, but it'll be useful soon, and
it's good for it to be available to any new back ends that might need
it. It will need some optimisation.
2020-04-19 22:57:10 +01:00
Christian Rasmussen
4d2b270db6 Allow spaces in file path for generated Chez programs 2020-04-18 18:18:02 +02:00
Matus Tejiscak
f37d69ceb7 Add tests/idris2/record003. 2020-04-18 14:04:30 +02:00
Matus Tejiscak
2d02899679 Adjust some tests. 2020-04-18 12:19:17 +02:00
Ohad Kammar
767d9dc5f3 Add tests for default implict record type arguments 2020-04-17 12:22:36 +01:00
Ohad Kammar
aa451022b5 Add tests for fully abstract records in Idris and Yaffle 2020-04-16 02:49:32 +01:00
Arnaud Bailly
5544919c31 use quotient on scheme backends
We compile divisions of Integers to quotient instead of '/' and add
some tests for numbers
2020-04-15 10:52:35 +02:00
Matus Tejiscak
b5689e5b25 Disable tests relying on cast-string-int. 2020-04-14 22:44:18 +02:00
Matus Tejiscak
1112f01dc6 Add reg016 to tests. 2020-04-14 22:12:36 +02:00
Matus Tejiscak
4827d0447b Add division tests. 2020-04-14 22:01:31 +02:00
Matus Tejiscak
c7fe4f1a63 Update the expectation file. 2020-04-14 21:36:14 +02:00
Matus Tejiscak
b20ae8d36b Add a test. 2020-04-14 21:30:04 +02:00
Guillaume Allais
f10edd51f5 [ fix #279 ] comment delimiters with more than one dash 2020-04-14 14:13:38 +01:00
Edwin Brady
0ed9f6cee6 Occasional performance boost
Check for conversion without reducing names, before unifying arguments.
This is quick to check, and can save a lot of evaluation.
2020-04-12 18:01:45 +01:00
Edwin Brady
841c3f27a5 Change order of argument search in auto implicits
For consistency with interactive expression search
2020-04-10 15:39:45 +01:00
Edwin Brady
69a7640a6e Allow flagging types as externally defined
e.g. in a C file. This means we don't accidentally treat things as
empty, since previously we just defined these as empty types, but that
broke coverage checking. Fixes #240
2020-04-10 11:45:52 +01:00
Edwin Brady
0daece1e0e Fix where under multiple cases
The names the locals were being applied to weren't being updated
properly, so applications of local functions inside case blocks were
sometimes given the wrong arguments. This is one of the few places where
it's hard to keep track of names in the type system! So naturally that'd
be where things go wrong I suppose...
2020-04-09 18:47:39 +01:00
Edwin Brady
1c4b558b26
Merge pull request #271 from ohad/bugfix-269
Bugfix #269
2020-04-06 22:27:19 +01:00
Edwin Brady
3b07afc601
Merge pull request #268 from gallais/interactive-test
[ new ] interactive test runner
2020-04-06 22:12:15 +01:00
Ohad Kammar
fbf82eaf0b Bugfix #269
Make desugaring/elaboration of interfaces, interface implementations,
records, and parameter blocks take into account the pragma
`%unbound_implicits off`.

Main changes:

(a) Execute the pragma also during desugaring
(b) Check whether `isUnboundImplicits` is on at each desugaring step

Alternatives I didn't take:

(1) Changing `findBindableNames` to effectfully check the flag.

  Rationale:
  Apart from turning a pure function into an effectful one, this
  would mean repeatedly calling `findBindableNames`, only to do
  nothing once the flag is read.

(2) Adding another function that takes multiple places (list of terms)
  that might contain bindable names, and before dispatching
  `findBindableNames` on each term, checking the flag.

  Rationale: I didn't want to add another abstraction. (weak
  rationale)

@edwinb @gallais : if you prefer (2), I can do that.
2020-04-06 15:56:48 +01:00
Guillaume Allais
6e2ccb085e [ more ] show the diff in case of mismatch 2020-04-06 11:29:18 +01:00
Guillaume Allais
5ae54488d7 [ new ] interactive test runner 2020-04-06 11:06:19 +01:00