Commit Graph

2818 Commits

Author SHA1 Message Date
Denis Buzdalov
853547e99c [ golden ] Allow test dir names to contain spaces 2021-09-14 12:05:46 +01:00
Ruslan
9e4d97fbea
invFin: export ~> public export and invFinSpec (#1890)
* export ~> public export

* Add a theorem about `invFin` specification

* Lower the visibility level of `invFinSpec`
2021-09-10 16:06:11 +01:00
stefan-hoeck
281ae86ece [ fix ] string casts on js backends 2021-09-10 08:48:29 +01:00
Mathew Polzin
654d399eaf
Add function that checks whether a file handle points to a TTY device. (#1908)
* Add function that checks whether a file is a terminal device.

* support isTTY function for NodeJS backend.

* don't accidentally interpret 'false' string as truthy number

* less code duplication.
2021-09-10 08:05:21 +01:00
Guillaume ALLAIS
6a6ad3057d [ fix ] consolidating mismatchNF 2021-09-09 18:37:49 +01:00
Guillaume ALLAIS
1f85265193 [ re #1632 ] (->) does not unify with any of TCon/Type/PrimVal 2021-09-09 18:37:49 +01:00
G. Allais
911a907e74
[ highlighting ] Builtin.assert_ functions using postulate face (#1914) 2021-09-09 18:37:37 +01:00
Jan de Muijnck-Hughes
155989110b
[ base ] Indexing Vectors. (#1892) 2021-09-09 10:45:11 +01:00
Guillaume ANDRIEU
71511f4bdd
code-blocks missing in the docs (#1911)
* Update strings.rst

For some reasons the code blocks which are not set as 'idris' are not displayed in the readthedocs rendering.

* Update overloadedlit.rst

* Update overloadedlit.rst
2021-09-08 18:46:46 +01:00
Guillaume ALLAIS
6fcb8b1073 [ cleanup ] Compiler.Opts.CSE
* Use `when`
* Avoid testing `log "compiler.cse" 10` on every single entry of the list
2021-09-08 18:46:20 +01:00
Guillaume ALLAIS
30aa38f707 [ cleanup ] Compiler.Common 2021-09-08 18:46:20 +01:00
Stefan Höck
af5657d23a
[ performance ] Memoise toplevel constants (#1899)
* [ performance ] memoize toplevel constants

* [ test ] memoization tests

* [ fix ] fix blodwen-lazy for racket and gambit
2021-09-08 16:46:19 +01:00
Matthieu Coudron
6780874d2e nix flake: make it more idiomatic
so that one can pass attributes directly to buildIdris instead of the
convoluted.
buildIdris (...).build.overrideAttrs(oldAttrs: {})
2021-09-07 16:34:45 +01:00
Guillaume ALLAIS
b231ef0da5 [ fix #1831 ] Be more careful about checking primitive names 2021-09-07 11:23:26 +01:00
Edwin Brady
c861845757
Abandon ambiguity resolution on undefined name (#1907)
* Abandon ambiguity resolution on undefined name

This has finally annoyed me enough to do something about it. If we get a
"no such variable" error there's no point exploring other branches.

* Removes spaces from test file

One day I'll update the linter to ignore test files. We should really
accept literally anything as a possiblity for test files, even if
removing the spaces is tidier.

* Reset context before throwing in 'successful'

Although I don't think this is strictly necessary for a fatal error, we
should still for the sake of tidiness reset the state when backtracking.
2021-09-07 00:41:08 +01:00
Edwin Brady
9865765d1d
Normalise errors on display, not when they arise (#1906)
* Move Context into its own file

Just the core definition - this is so that we have access to it in
Core.Core, for inclusion in error messages, to save normalisation of
terms in errors until we actually show them.

* Normalise errors on display, not when they arise

This can save a lot of time in ambiguity resolution if the errors are
complicated, because the errors might never be displayed if it's in an
abandoned branch.

This involves lifting 'Context' out of Core.Context, because we need to
store it in Error, which is needed by Core, which in turn is needed in
Core.Context.

Also moved a couple of test caes from ttimp to idris2, so that the
errors get rendered properly and won't need updating unnecessarily. In
fact all of the ttimp tests - which were just part of the initial
scaffolding - are probably now subsumed by the idris2 tests.

* Add new coverage001 test files
2021-09-06 23:37:59 +01:00
Edwin Brady
2a5739c27a
Check primitives (fromInteger etc) reduce on LHS (#1903)
If they don't, we can't turn them into patterns to match on, and we end
up looping. Possibly we could throw a different and maybe more
informative error instead of just making an unmatchable pattern.
Fixes #1895
2021-09-05 12:37:59 +01:00
Edwin Brady
c3a072c557
Speculative normalisation (#1902)
* Split Normalise into three files

Evaluation, Quoting, and Conversion checking are distinct steps, and I'm
about to add some variations to quoting so better to reorganise a bit.

* Add a Quote mode that limits size of result

Sometimes normalising an expression is a good idea because it makes
things smaler, and sometimes it isnt, because it doesn't. We can't tell
in advance which situation we're in, but we can try speculatively
normalising something. This is good for case types and hole types - we
generally want the normal form, but if that's expensive, we should stop.

So, quote is now able to give up if it passes a certain size threshold
for stuck applications. By experimentation, it seems that up to 10
doesn't hurt too much, but beyond that it's better not to normalise at
all.

* Add the new normalise files
2021-09-05 01:35:21 +01:00
Nick Drozd
5126600fa6 Cut some unused imports 2021-09-04 08:39:24 +01:00
Nick Drozd
7d6042a26e Prove associativity and commutativity for 01W 2021-09-04 08:39:24 +01:00
Nick Drozd
b918f1c105 Simplify 01W Preorder 2021-09-04 08:39:24 +01:00
Denis Buzdalov
5d70c746b1 [ prelude ] Implement Semigroup for ordinary pairs 2021-09-03 18:00:03 +01:00
Guillaume ALLAIS
257783275e [ new ] --total cli flag 2021-09-03 12:07:29 +01:00
Guillaume ALLAIS
b35e54829d [ cleanup ] use whenJust 2021-09-03 12:07:29 +01:00
Denis Buzdalov
d62e45d8d8 [ contrib ] Make sorted map be able to store dependently typed values 2021-09-02 10:57:19 +01:00
Stefan Höck
031508a790
[ performance ] Common subexpression elimination (#1869)
* [ wip ] common subexpression elimination

* [ performance,js ] lazy initialization

* [ fix ] return filtered usage map

* [ doc ] annotated Compiler.Opts.CSE

* [ doc ] some more code annotations

* [ doc ] fix typo

* [ doc ] of course I had some help

* [ wip ] CSE optimize additional IRs

* [ performance ] allow lazy thunks to be garbage collected

* [ fix ] added GlobalDefs for extracted sub expressions

* [ cleanup ] pass compiled defs around explicitly

* [ cleanup ] dont cse-analyze main expression twice
2021-09-02 06:47:35 +01:00
withoutK
abd0552526
[ docs ]: fix typo (#1893)
[ci: skip]
2021-09-01 21:06:29 +01:00
Guillaume ALLAIS
1d1c428805 [ re #1828 ] test case 2021-09-01 11:32:51 +01:00
Guillaume ALLAIS
a7d73d0d3d [ new ] ellipses for with patterns
Rather than Agda's `...` we use the common symbol for "I don't care": `_`.
2021-08-31 22:50:46 +01:00
Guillaume ALLAIS
9498f44603 [ fix ] Parse let _ = as Let rather than LetPat 2021-08-31 22:50:22 +01:00
Guillaume ALLAIS
d289ed653d [ fix #1887 ] Parse _ <- as DoBind instead of DoBinPat 2021-08-31 22:50:22 +01:00
Kamiλ Shakirov
2428b356f4
[ install, docs ] Add a new makefile target to install libdocs (#1884) 2021-08-31 18:41:03 +01:00
Guillaume Allais
0e4168edbf [ ci ] ignore Release/ for idris2 builds 2021-08-31 13:56:45 +01:00
Kamil Shakirov
bd94b91615 mkdist.sh script cleanup
Since Travis CI is no longer used.
2021-08-31 13:56:45 +01:00
Mathew Polzin
ef91cc01c7 Add list difference to base Data.List module. 2021-08-31 13:21:43 +01:00
Kamil Shakirov
08d9e7d82c [ install ] Install non-executable files with the executable flag off 2021-08-31 13:21:19 +01:00
Guillaume ALLAIS
79177a70ea [ fix #1788 ] Only mention building using the previous version
We only ensure using CI that Idris can be built using the previous
released version so let's not claim in the docs you can use any old
one.
2021-08-30 17:11:17 +01:00
Stiopa Koltsov
126daf7c28 Remove DirInfo.error
The field is not used.
2021-08-30 17:08:15 +01:00
madman-bob
7a3d557bab
Add copyDir function (#1805)
Co-authored-by: Stiopa Koltsov <stepan.koltsov@gmail.com>
2021-08-30 16:42:58 +01:00
Joel Berkeley
078db21edf
Return a Vect from Stream take (#1812)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-08-30 16:00:20 +01:00
Mathew Polzin
cdc157a333 Add javascript support for getting system time as integer. 2021-08-30 15:35:49 +01:00
madman-bob
3e1f6aba56
Add copyFile to System.File (#1797)
Co-authored-by: Stiopa Koltsov <stepan.koltsov@gmail.com>
2021-08-30 15:31:37 +01:00
G. Allais
1e0027721f
[ fix #1859 ] Undo my mistakes (#1866) 2021-08-27 16:18:24 +01:00
Peter Hajdu
2d7ddc6e64 [ fix #472 ] Port doc about comments from Idris1 2021-08-27 14:58:35 +01:00
G. Allais
e2addcf27d
[ new ] semantic highlighting via the IDE mode (#1868) 2021-08-27 14:47:35 +01:00
loovjo
70ac0f4101 Specify libc-name for tarm64osx 2021-08-25 12:03:01 +01:00
Guillaume ALLAIS
99b005886f [ fix ] invalid Cast instances
integerToNat is only equal to `believe_me` at runtime, not at compile
time. You'd believe it cannot be a problem given that the implementation
of `Cast` is not exported but the REPL reduces everything.
2021-08-25 12:02:04 +01:00
Stefan Höck
2465418610
[ fix ] fix #1839 (#1857)
* [ fix ] fix #1839

* [ test ] console width 0 in test
2021-08-24 15:43:22 +01:00
Niklas Larsson
a940c37742
Merge pull request #1858 from stefan-hoeck/browser_putStr
[ new ] support prim__putStr in browser backend
2021-08-24 11:58:48 +02:00
stefan-hoeck
ed9a21f6bc [ new ] support prim__putStr in browser 2021-08-24 03:44:57 +00:00