1
1
mirror of https://github.com/idris-lang/Idris2.git synced 2024-12-28 22:22:10 +03:00
Commit Graph

1308 Commits

Author SHA1 Message Date
Edwin Brady
2761a27357
Merge pull request from nickdrozd/algebra-implementations
Add some algebra implementations
2020-08-04 13:21:12 +01:00
Edwin Brady
fd3d086ebc Add an export declaration
Not strictly necessary, but needed to keep Idris2-boot happy!
2020-08-04 13:09:53 +01:00
Edwin Brady
3a6614b227 Look at intermediate results in program search
This has involved quite a bit of reorganisation and some improvements in
resugaring so that the results look nice. In summary:

* Expression search now gives back a RawImp rather than a checked term,
  which allows it to include case expressions
* Case with one pattern is resugared to a destructuring let
* Some name generation issues address in function generation

We look at intermediate results for local variables which are functions
that return a concrete type, or recursive calls that return a single
constructor type. In these cases, we:

* let bind the local variable/recursive call
* generate a new definition for the scope, as a 'case' function

When we recursively generate the definition, it's a bit more restricted
so as not to explode the search space. We only take the first result, we
only look one constructor deep, and we go right to left on variable
splitting so only deconstruct the name we've just added.
2020-08-04 12:51:57 +01:00
Wanja Chresta
14086fa1dd Add installation instructions for nix 2020-08-04 12:25:49 +01:00
Mark Barbone
cef248e5a7 Make showParens public 2020-08-04 10:58:00 +01:00
Niklas Larsson
b7cf3588c9
Merge pull request from melted/startup_scheme
Quote the chez path in windows sh startup
2020-08-04 10:57:53 +02:00
Niklas Larsson
1b19564530 Quote the chez path in windows sh startup 2020-08-04 10:30:53 +02:00
Kamiλ Shakirov
143d2c5b11 Fix the code generator name for JavaScript CG
js -> javascript
2020-07-30 14:20:50 +01:00
Kamiλ Shakirov
d5f35ff0be Add another recent video talk on Idris 2
Also, rearrange videos in reverse chronological order to show the most recent videos first
2020-07-30 11:31:20 +01:00
Ohad Kammar
91c5ddd411
Merge pull request from ohad/irrelevant-list-nonempty
Add irrelevance annotations to Data.List functions taking NonEmpty
2020-07-30 10:02:46 +01:00
Ohad Kammar
5cfbac4a51 Add irrelevance annotations to Data.List functions taking NonEmpty 2020-07-30 06:01:42 +01:00
Edwin Brady
5ad779f9de
Merge pull request from edwinb/search0-heuristic
Add a heuristic for sorting search results
2020-07-30 00:38:00 +01:00
Edwin Brady
ff48bb2310 Update literate test results
New search heuristic finds a slightly better zipWith, in particular.
2020-07-30 00:08:06 +01:00
Edwin Brady
8d7fa5c642 Add a heuristic for sorting search results
Sort by proportion of bound variables used, which is likely to get us
the right answer quicker. The results are generated in batches of 16 (a
completely arbitrary choice) then sorted.
2020-07-29 23:54:52 +01:00
Alex Gryzlov
69612bf6bf
Add list lemmas () 2020-07-29 10:51:07 +01:00
Edwin Brady
78ecd8a9f1
Merge pull request from ohad/undotting-subsingletons
Take into account syntactic sub-singletons when dotting in patterns
2020-07-28 00:23:46 +01:00
Ohad Kammar
20ca6cc651 Address comments from code-review (bugs fixed)
Use `NTCons` when counting number of type constructors
Use `Maybe` for return type
2020-07-27 22:48:44 +01:00
Ohad Kammar
ac0b5a3f3b Take into account syntactic sub-singletons when dotting in patterns
When an erased pattern argument in a non-erased context is of a
datatype that has 0 or 1 constructors, there is no need to dot it
(i.e., require that the canonical term is inferred by other
dependencies): it has to be the unique constructor that appears in the
source.
2020-07-27 20:47:30 +01:00
Edwin Brady
77039bcdea
Merge pull request from edwinb/more-search-stuff
More search stuff
2020-07-27 16:42:59 +01:00
Edwin Brady
7083f7ac13 Add a 'reject' count to :gd
This gives the number of implementations to reject before accepting one.
It's intended as a reasonably cheap way of giving multiple results from
interactive editing (e.g. the vim mode, which goes via the REPL and
--client rather than the IDE mode)
2020-07-27 14:56:16 +01:00
Edwin Brady
f33873d051 Add IDE mode commands for gdnext and psnext
I forgot to add these to the parser!
2020-07-27 14:44:09 +01:00
Edwin Brady
3a0a566607
Merge pull request from edwinb/search-stuff
More search improvements
2020-07-27 14:14:59 +01:00
Edwin Brady
df635cf8d7 Add :psnext and :gdnext at the REPL
These continue the search from :ps and :gd next respectively, giving the
next search result until there are no more results.
Correspondingly, added ':proof-search-next' and ':generate-def-next' in
IDE mode, which continue the search from the previous ':proof-search'
and ':generate-def' respectively.
2020-07-27 13:45:10 +01:00
Edwin Brady
f8ef44f1b0 Allow multiple results from generate-defs
Return a 'Search' rather than a single definition. Also, change the
order of search in expressions so that we look at recursive calls
earlier when under a constructor - the assumption being that this is
more likely than nested constructors.
2020-07-27 12:04:39 +01:00
Edwin Brady
58bc918f5d
Merge pull request from edwinb/exprsearch
Reorganise expression search
2020-07-26 18:08:42 +01:00
Edwin Brady
c860e5e690 Merge github.com:idris-lang/Idris2 2020-07-26 17:39:00 +01:00
Edwin Brady
6d96341776 Reorganise expression search
Rather than returning a complete list of results, return a pair of the
first result, and a continuation. The continuation explains how to
continue the search if the given result is deemed unacceptable (either
on encountering an error somewhere, or just if the caller wants the next
result).

This means we don't search needlessly if we're only looking for the
first result. Fixes 
2020-07-26 17:34:24 +01:00
Ohad Kammar
915b7bea38 Add various instances from stdlib interfaces (Eq, Ord, DecEq)
For Void and Either

This is because I ended up using them elsewhere, so why not include them in the stdlib.

Also expose left/rightInjective functions, as are used in the DecEq proofs.
2020-07-26 10:47:38 +01:00
Niklas Larsson
eeb1d22234
Merge pull request from donovancrichton/pi-type-pattern-match
Added explicit case to headEq to allow matching on Pi Types.
2020-07-25 11:50:58 +02:00
Donovan Crichton
048f1887ea Added explicit case to headEq to allow matching on Pi Types. 2020-07-25 12:59:33 +10:00
Rui Barreiro
736b91b118 ups 2020-07-24 20:23:34 +01:00
Rui Barreiro
7e27d03ef9
Update docs/source/backends/javascript.rst
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
2020-07-24 19:10:11 +01:00
Rui Barreiro
503c513aef
Update docs/source/backends/javascript.rst
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
2020-07-24 19:09:47 +01:00
Rui Barreiro
99ea8f59aa
Update docs/source/backends/javascript.rst
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
2020-07-24 19:09:38 +01:00
Rui Barreiro
10be065553
Update docs/source/backends/javascript.rst
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
2020-07-24 19:09:27 +01:00
Rui Barreiro
211a5e55cc javascript codegen minimal doc 2020-07-24 18:28:20 +01:00
Giuseppe Lomurno
39f23ffd9b Prec version of pretty interface 2020-07-24 15:19:17 +01:00
Giuseppe Lomurno
ab1f383912 Laziness annotations for performance 2020-07-24 15:19:17 +01:00
Giuseppe Lomurno
62524e8462 Tree representation for prettyprinting 2020-07-24 15:19:17 +01:00
Giuseppe Lomurno
3d51af46c2 Namespace change 2020-07-24 15:19:17 +01:00
Giuseppe Lomurno
eb659ba907 Added prettyprinting library 2020-07-24 15:19:17 +01:00
Adam Harries
3f4fd8e4aa
Document samples/ffi, and change name of .so to better suit convention. ()
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2020-07-24 13:21:48 +01:00
Niklas Larsson
2542c325b1
Merge pull request from iclanzan/patch-2
Fix typo
2020-07-23 14:51:31 +02:00
Niklas Larsson
57f89ccd9a
Merge pull request from melted/directive_arg
Add `--directive` cli option
2020-07-23 14:50:53 +02:00
Niklas Larsson
7e0bca23fd Add --directive cli option
It sends a codegen directive to the current codegen. It's useful
for sending options you don't want to hard code in the source. Examples
include enabling profiling or setting a target.
2020-07-23 13:50:46 +02:00
Niklas Larsson
ff235bd30b
Merge pull request from nixCodeX/fromInteger-0
Fix fromInteger 0 for Bits8, Bits16, Bits32, Bits64
2020-07-21 17:32:49 +02:00
Jonathan Tanner
5c73ada68a Fix fromInteger 0 for Bits8, Bits16, Bits32, Bits64 2020-07-21 15:29:09 +01:00
Sorin Iclanzan
2d15b59e6d
Fix typo 2020-07-21 09:26:46 -04:00
Denis Buzdalov
0119c217c9 Putting .ipkg mentioning to a variable and making names symmetrical. 2020-07-21 11:05:47 +01:00
Niklas Larsson
8a210d536e
Merge pull request from melted/buffer_api
Add concatBuffers and splitBuffer to Data.Buffer
2020-07-21 10:43:17 +02:00