Commit Graph

1188 Commits

Author SHA1 Message Date
Matus Tejiscak
bd1a9e2c04 Fix printing qualified record field names. 2020-04-23 22:29:33 +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
Matus Tejiscak
eb5af61ebf Add reference for the dot record syntax. 2020-04-23 21:57:03 +02:00
Edwin Brady
3d8d07621d Some inlining changes
Flags can now be set on implementations too, where the flags get passed
to each of the methods in the implementation. We might want something a
bit more fine grained than this later. Also some small changes to the
way inlining lets is done in the compiler.
2020-04-23 20:01:20 +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
MarcelineVQ
4b878a8a53 change where openHints is snapshotted
clearing the open hints at the end of elabImplementation was missing the
'using' hints
2020-04-22 16:51:09 -07:00
Fabián Heredia Montiel
7762c1b23f Basic Show instance of NameMap 2020-04-22 14:43:03 -05:00
André Videla
db743eb9c4 update core/TT 2020-04-22 20:39:32 +01:00
André Videla
df82764ce7 merge ProccessData 2020-04-22 20:39:32 +01: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
André Videla
6d63dad4b1 Replace RigCount by Semiring operations
This replaces all occurences of pattern matching on RigCount
by functions on generic semirings like `ring0` (erased) `ring1`
(linear) and `maxVal` (unbounded)

Pattern matching is replaced by `isRig1`, `isRig0` or `elimSemi`.
2020-04-22 20:31:38 +01:00
Ben Davies
5a8d9780be Document which Racket packages are required to run Idris 2020-04-22 12:28:45 -03:00
Ben Davies
6314e9144a Add missing racket/math import for Racket codegen 2020-04-22 12:28:41 -03:00
Ben Davies
93871c5fb9 Fix builds on *BSD
This makes it so gmake gets used instead of make on *BSD, refactors how
platforms are handled in general.
2020-04-22 11:09:05 -03:00
Kamil Shakirov
1d2250062b Fix tests 2020-04-22 11:56:08 +06:00
Kamil Shakirov
5b58bf2cc1 Add missing export 2020-04-22 11:21:12 +06:00
Kamiλ Shakirov
0c7b553e23
Oops 2020-04-22 08:48:38 +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
f4fa0340c1 Fix merge fallout. 2020-04-21 23:32:49 +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
Kamil Shakirov
35994b81e9 Port prelude's inline API documentation from Idris 1 2020-04-22 01:40:40 +06:00
Jan de Muijnck-Hughes
0e73bf976b Updated the CHANGELOG to mention literate mode. 2020-04-21 19:31:21 +01:00
Jan de Muijnck-Hughes
89b68d7771 Added documentation on literate modes to the reference document. 2020-04-21 19:27:46 +01:00
Jan de Muijnck-Hughes
203bc3cb66 Removed bird style hidden lines from style. 2020-04-21 19:27:46 +01: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
Edwin Brady
be8b157ead
Merge pull request #290 from LibreCybernetics/minor-unicode-identifier-fixes
Refactor Parser.Lexer.{ident, OpCode} for reuse in IDEMode
2020-04-21 18:09:58 +01:00
Edwin Brady
1a41a265b9
Merge pull request #299 from chrrasmussen/fix-chez-in-folder-with-spaces
Allow spaces in file path for generated Chez programs
2020-04-21 17:04:37 +01:00
Fabián Heredia Montiel
6ea8b477ed Refactor ident to reuse in IDEMode, fixes out of sync bug.
Related: 1a4f424259 on 2019-September-28
2020-04-21 09:37:36 -05: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
d39c701f28 Add 'using' hints at the right time
They need to be added before checking the top level types of the
interface methods, because those types will use them.
Fixes #291
2020-04-21 11:47:35 +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
9aca77c5dd
Merge pull request #293 from gallais/casetree
Refactoring code as I read through it
2020-04-21 10:54:12 +01:00
Edwin Brady
60c4f8e178
Merge pull request #287 from Porges/patch-1
Fix Idris1 download link
2020-04-21 10:52:00 +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
69e774bd00 Merge branch 'jeetu7-master' 2020-04-21 10:48:11 +01:00
Edwin Brady
9930b64c1c Merge branch 'master' of https://github.com/jeetu7/Idris2 into jeetu7-master 2020-04-21 10:47:38 +01:00
Edwin Brady
ac277ce6d0 Erase the World, with care
We can erase things of type %World, which opens up more possibilities of
newtype and helps optimise IO, but we need to be sure that the side
effecting operations aren't optimised away as a result because we no
longer have to inspect the newtype. Therefore, if optimising away a case
analysis on a newtype with a %World deleted, add a let binding for the
scrutinee of the case, and flag it as non-inlinable.
2020-04-21 10:47:19 +01:00
Edwin Brady
5ea11cf0f5
Merge pull request #282 from abailly/network-binary
provide building blocks for binary network I/O
2020-04-21 10:45:52 +01:00
Edwin Brady
d3d5e22011
Merge pull request #274 from ska80/tutorial/typos
Fix some typos in the tutorial
2020-04-21 10:39:53 +01:00
Edwin Brady
4b65d8d6fc
Merge pull request #273 from jfdm/badges
Added a travis badge because it's good to have badges...
2020-04-21 10:39:09 +01:00
Edwin Brady
7cd9964d4f Comment correction
The comments don't get type checked, but this was rather important :).
2020-04-19 23:45:30 +01:00
Edwin Brady
f6bbfb3dee Remove costly 'swapBlocks' in lambda lifter
No need if we separate the context into arguments from the outer scope,
and arguments from the current scope. Needs care to compile correctly,
though.
2020-04-19 23:42:13 +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
Edwin Brady
8fccd5f2a3 Properly erase constructor arguments
That is, really erase the argument position rather than just putting
'erased there. It doesn't make a huge difference to the generated scheme
performance, but since we can always do this for constructors, we might
as well.
2020-04-19 19:43:51 +01:00