Commit Graph

1528 Commits

Author SHA1 Message Date
Zoe Stafford
677acf0d84
Treat unit types as erased in constructors (#3002)
* Treat unit types as erased in constructors

* Cleanup + dump ttc version

* Update CHANGELOG.md
2023-07-05 19:51:34 +01:00
Robert Wright
af3c5fd454 Generalize Prelude proof helpers 2023-07-05 16:36:09 +01:00
Steve Dunham
ecf4765c4b
[ fix ] Fix issue with eager evaluation of crashing functions (fixes #3003) (#3004)
* [ fix ] Fix issue with eager evaluation of crashing functions

* Mark functions that call unsafe builtins as non-constant

* Better detection of crash primop when deciding if functions can be constant
2023-06-28 08:32:48 +01:00
Denis Buzdalov
5dcf62499d
[ elab ] Make elab scripts be able to record warnings (#2999) 2023-06-19 16:34:19 +01:00
Andre Videla
9797a79b53 [ new ] Allow fixities to be hidden with %hide
* Change the printing of namespaced operator to show
  parenthesis around operators
* Update warning when conflicting fixities are found
* Do not warn about redundant but compatible fixities
2023-06-14 11:19:59 +01:00
Alexander
a01b7e25d9 [parser] error message if use let-in in do block 2023-06-13 10:35:39 +03:00
Justus Matthiesen
bb6db779ef [ fix #1066 ] do not insert TForce on LHS
When we encounter a delayed (explicit) function type during elaboration
of a LHS, we strip off the delay modality, continue elaboration and return a delayed version of the resulting type.

Note: defining delayed function via pattern matching is not currently
supported. Doing so will require adding a delay marker to LHSs/contexts
familiar from modal type theories. Implicit function are also currently
not supported.
2023-06-12 11:04:59 +01:00
Aleksei Volkov
e594669210
[ fix #1878 ] Programmer-provided terms should be alwaysReduce (#2977)
* [ fix ] Programmer-provided terms should be alwaysReduce

This ports Edwin's commit that fixes the original issue back to Idris

Co-authored-by: Edwin Brady <ecb10@st-andrews.ac.uk>

* [ tests ] Added regression test for #1878

* Updated CHANGELOG.md and CONTRIBUTORS

---------

Co-authored-by: Edwin Brady <ecb10@st-andrews.ac.uk>
2023-06-01 17:08:02 +01:00
Justus Matthiesen
00af44c708
Ignore UseSide annotation in non-linear as-patterns (#2984)
Co-authored-by: Aleksei Volkov <volkov.aa@phystech.edu>
2023-06-01 14:34:57 +01:00
Thomas E. Hansen
50c56eac8f [ fix ] Revert lazy+codata being reserved prims
This reverts part of commit 4febd31c67.

Moved to PR #2992, as this reverted change is separate from adding
`:doc` support for these. There is potentially more discussion to be had
in the new PR.
2023-05-30 09:46:24 +02:00
Thomas E. Hansen
1f7773ebf8 [ new ] Implement :doc for laziness primitives
* Restructured the parser to be a bit nicer around these as well
    (subject to approval).

Fixes #2599
2023-05-30 09:46:24 +02:00
Steve Dunham
d3e896ea09 [ fix ] Improve error messages at end of if statements 2023-05-20 09:16:25 +01:00
Stefan Höck
2739c3a389
[ codegen ] more flexible array implementation on JS backends (#2966) 2023-05-14 06:45:50 +01:00
Steve Dunham
edc000c568 [ fix ] Fix issue parsing __LOC__ arguments 2023-05-14 06:45:33 +01:00
Steve Dunham
7221c99e93 [ error ] Improve error messages for indentation issues 2023-05-13 10:25:38 +01:00
Asafov Alexander
6b768f28b1 Ignore tryAlt Result values in Core.Normalise.Eval 2023-05-09 11:42:10 +02:00
Asafov Alexander
2cafbe217b Returning function names evalConAlt and evalTree in Core.Normalise.Eval 2023-05-09 11:42:10 +02:00
Asafov Alexander
f93c927952 [ perf ] make Core.Normalise.Eval.evalDef stack safety 2023-05-09 11:42:10 +02:00
stefan-hoeck
3c9393e5a8 [ codegen ] constant fold believe_me 2023-05-06 14:52:14 +01:00
Stefan Höck
e34b5a64f0
[ codegen ] get rid of trivial let statements (#2961) 2023-05-06 08:35:17 +01:00
Mathew Polzin
177bcff725 [fix] Correct spellings of auto-implicit depth and metavar threshold. 2023-04-24 07:00:09 +01:00
Justus Matthiesen
360232de35 [ refactor ] renamed checkDesc to checkNonDesc 2023-04-23 17:42:04 +01:00
Justus Matthiesen
1d3bad7c0e [ doc ] reference to termination paper 2023-04-23 17:42:04 +01:00
Steve Dunham
97b7697a0e [ fix ] Issue in totality checking 2023-04-23 17:42:04 +01:00
Steve Dunham
3ad391d597
[ fix ] codegen issue when using partial case statements in prelude. (#2952) 2023-04-23 11:07:04 +01:00
Thomas E. Hansen
a423715da1 [ new ] Add compile.casetree.missing topic
This allows us to track when we're compiling non-covering case blocks.
2023-04-22 08:33:38 +01:00
Steve Dunham
a75161cb20 [ parser ] Improve error message for missing comma or period in forall. 2023-04-07 08:42:42 +01:00
G. Allais
b185f1ff85
[ new ] %unsafe pragma for escape hatches (#2937) 2023-04-03 21:42:47 +01:00
Adowrath
6b38592b5a Add HasNamespaces Lifted* implementations 2023-03-29 09:00:06 +01:00
Bertalan Kis
c64c6a43aa make cond's default argument lazy 2023-03-15 10:15:50 +00:00
Zoe Stafford
442c5b529f
Collect constructors on the left hand side of case alternatives (#2919)
* [ fix ] collect constructors on LHS of cases alts

* [ tests ] Updated expected
These functions do refer to these constructors at runtime, so this is the correct output

* Update CHANGELOG.md

* [test] update test output again
2023-03-14 15:05:19 +00:00
G. Allais
b5197d5c5d
[ fix ] partial evaluation implementation (#2899) 2023-03-07 08:31:29 +00:00
Denis Buzdalov
b03ce53e97 [ refactor ] Treat other out-of-order computations during logging 2023-03-06 12:56:39 +00:00
Denis Buzdalov
b5fe607f4e [ regression ] Do toFullNames only when logging happens 2023-03-06 12:56:39 +00:00
Zoe Stafford
2f47ce032a
Merge pull request #2912 from Z-snails/fix-typo
Fix typo
2023-03-05 13:00:27 +00:00
Zoe Stafford
5e3b9634fe
Fix typo 2023-03-05 11:06:05 +00:00
Zoe Stafford
dcb66a8757
Remove unused fixity declaration
This conflicts with a used one in `Data.String.Parser`
2023-03-05 10:18:20 +00:00
Justus Matthiesen
a40eaead0b [ fix ] don't erase argument when type is erased
When the linearity is called on an application in erasure mode, the
function type containing the relevant quantity may already be erased. In
that case, we return the original term and an empty usage.

Returning an empty usage is potentially incorrect but no linearity is
done in erasure mode, making his safe.
2023-02-27 13:41:55 +00:00
Andre Videla
0f4464a690 add logs to linear check 2023-02-25 22:29:34 +00:00
G. Allais
dc1b5387b8
[ re #2832 ] warn about conflicting fixity declarations (#2889) 2023-02-19 16:29:10 +00:00
pinselimo
2dbb824a93
[ doc ] Add constructor docstrings (#2789)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2023-02-19 10:15:39 +00:00
Justus Matthiesen
0ef1917bf0 [ cleanup ] move calcTerminating to Core.Termination.SizeChange 2023-02-17 14:47:33 +00:00
Guillaume Allais
3bccf8e212 [ fix ] highlight record constructor 2023-02-13 15:41:56 +00:00
Andy Lok
a1d0c7c478 [ fix #2087 ] Fix multiline string on CRLF 2023-02-13 14:21:09 +00:00
Guillaume Allais
f76c4c4307 [ fix ] respect visibility in forward data declarations 2023-02-08 22:00:25 +00:00
Guillaume Allais
72bd3eed45 [ doc ] for the size-change module
Having a dependent NameMap would allow us to give more precise
types for all of these functions.
2023-02-08 16:13:04 +00:00
Guillaume Allais
c6b96080c2 [ refactor ] split up Core.Termination 2023-02-08 16:13:04 +00:00
Justus Matthiesen
914d68858b [ termination ] faithful implementation of size-change graph termination analysis
- call sequences in termination errors now carry location information
- new error message (`BadPath`) for late-starting loops
- [ fix ] transitive closure of size-change graphs no longer ignores function arguments
- update existing tests accordingly
2023-02-08 16:13:04 +00:00
Justus Matthiesen
9fd28bc130 [ size-change ] implement Ord instance 2023-02-08 16:13:04 +00:00
Justus Matthiesen
263643defd [ new ] popping value from a SortedSet 2023-02-08 16:13:04 +00:00
Justus Matthiesen
692e389bb8 [ new ] popping key-value pair from a SortedMap 2023-02-08 16:13:04 +00:00
Justus Matthiesen
5f7ad73a35 [ new ] minimal value in a SortedSet 2023-02-08 16:13:04 +00:00
Justus Matthiesen
f2dfeb39cd [ new ] retrieving value associated with the minimal key from a SortedMap 2023-02-08 16:13:04 +00:00
Justus Matthiesen
9bdc875b79 [ new ] mapWithKey for name maps 2023-02-08 16:13:04 +00:00
Justus Matthiesen
eaa6c8b6d7 [ fix ] missing covering annotation 2023-02-08 16:13:04 +00:00
G. Allais
fba9f16a1c
[ fix ] positivity checker: assert_total & Lazy (#2876) 2023-02-07 12:35:33 +00:00
Steve Dunham
464797944a [ error ] Fix location of type errors in do block pattern matching 2023-02-04 23:07:49 +00:00
Guillaume Allais
21fa60ae6a [ re #2871 ] Fix the resolvedN issue for good 2023-02-04 16:10:47 +00:00
G. Allais
966a4813fb
[ fix ] respect totality annotations for data (#2862) 2023-01-26 11:03:22 +00:00
Mathew Polzin
4bedaac811
[ fix ] make color output toggling simpler and also more robust. (#2848)
* make color output toggling simpler and also more robust

* don't unintentionally assert that tests are run in an environment where colors are turned on.

* Update src/Idris/Env.idr
2023-01-22 13:35:57 -06:00
Mathew Polzin
24ac56de88
Moving Data.List.HasLength into base (#2844) 2023-01-16 00:07:21 -06:00
Zoe Stafford
b098de933d
Allow case-of-case to work on cases with defaults
The inner case can now have a default alternative.
This means `Prelude.Types.prim__integerToNat` is better optimised

before
```js
/* Prelude.Types.prim__integerToNat : Integer -> Nat */
function Prelude_Types_prim__integerToNat($0) {
 let $1;
 switch(((0n<=$0)?1:0)) {
  case 0: {
   $1 = 0;
   break;
  }
  default: $1 = 1;
 }
 switch($1) {
  case 1: return $0;
  case 0: return 0n;
 }
}
```
after
```js
/* Prelude.Types.prim__integerToNat : Integer -> Nat */
function Prelude_Types_prim__integerToNat($0) {
 switch(((0n<=$0)?1:0)) {
  case 0: return 0n;
  default: return $0;
 }
}
```
2023-01-08 11:01:53 +00:00
Zoe Stafford
f9dc56a5f4
[ performance ] String builder on all scheme backends (#2838)
* [ performance ] String builder on all scheme backends
    this makes it about 50x faster at printing scheme code

* [ lint ]

* Add new module

* [ fix ] miscompilation on racket
2023-01-03 11:53:52 +00:00
Zoe Stafford
ab0ff2754a
Merge pull request #2836 from mattpolzin/library-data
[ new ] [ proposal ] Allow libraries to ship a data dir
2023-01-03 10:38:30 +00:00
Steve Dunham
a84a5a32d9 Fix at-pattern leak in recursive with blocks (#2834) 2022-12-28 09:08:09 +00:00
Mathew Polzin
d53a277a34 Allow libraries to ship a data dir at a standard location within their install directory. 2022-12-27 20:44:16 -06:00
Zoe Stafford
217271a623
Js shebang (#2830)
* add shebang to outputted node file
after `chmod`ing the file, it can be run directly
ie `./build/exec/test` rather than `node ./build/exec/test``

* update CHANGELOG.md

* [ linter ]

* [ linter ] again...
2022-12-22 14:56:44 +00:00
Guillaume Allais
1092804726 [ fix #2821 ] Failing blocks should force delayed holes 2022-12-21 11:16:26 +00:00
Stefan Höck
d2c8cf461b
[ performance ] Compile non-recursive top-level constants to constants in Chez (#2817) 2022-12-21 08:48:20 +00:00
G. Allais
0194539ef7
[ new ] __LOC__, __FILE__, __LINE__, __COL__ magic debug strings (#2819)
* [ new ] __LOC__, __FILE__, __LINE__, __COL__ magic debug strings

* [ fix ] the point is to test whitespace being ignored

* [ fix ] golden values
2022-12-17 18:12:39 +00:00
G. Allais
2f55a3ef8a
[ fix ] elaboration of records' telescopes of parameters (#2816) 2022-12-15 17:55:50 +00:00
Justus Matthiesen
e673d05a67
[ fix ] jump-to-definition (":name-at" IDE command) (#2811) 2022-12-09 17:02:57 +00:00
Markus Pfeiffer
c3bbdb30a1
Add mustWork in GADT data declaration parser (#2805)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-12-09 16:04:11 +00:00
Guillaume Allais
9bcaa104f3 [ new ] logging topics autocompletion in the emacs REPL 2022-12-08 21:06:39 +00:00
locriacyber
cb30d7cda8
Install *.ttm on idris2 --install (#2796)
Co-authored-by: Justus Matthiesen <mail@justusmatthiesen.com>
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-12-08 21:06:17 +00:00
Ruslan
d44ddc7f11
Let qualified do-notation apply to pure and to idiom brackets (#2786) 2022-12-07 22:27:58 +00:00
Ellis Kesterton
9931f35b6b
Improve parser error messages when using reserved identifiers in decls (#2803)
Co-authored-by: Ellis Kesterton <erk4@st-andrews.ac.uk>
2022-12-07 16:09:26 +00:00
G. Allais
32f92746b3
[ perf ] compile Core.CompileExpr.Pretty faster (#2800) 2022-12-07 10:08:31 +00:00
Guillaume Allais
085ea348ae [ perf ] use integers in the buffer state 2022-12-06 21:13:55 +00:00
Guillaume Allais
ebc406c519 [ perf ] cherrypick fast weakenNVar from yaffle 2022-12-06 12:28:16 +00:00
G. Allais
fcbd9e9190
[ fix #2794 ] Do not ignore notinline lets in identity detection (#2795) 2022-12-06 11:41:30 +00:00
G. Allais
85bb822f3b
[ perf ] manually eta-expand unsaturated io_bind calls (#2785) 2022-12-01 15:31:00 +00:00
Steve Dunham
f443723f4e [ parser ] fix issue where indentation is not checked in record parameters 2022-11-25 08:22:37 +00:00
Robert Wright
7d9d39c045 Use escaped version of system in Idris src 2022-11-21 10:51:43 +00:00
Steve Dunham
56a9bc6be4 [ error ] Improve locality of parse errors in implicit arguments 2022-11-21 10:40:40 +00:00
Marek L
0e657aeba1 [ ide-mode ] Do not include whole error message in building file
display result message.

Why:
Makes the error message being displayed twice in Emacs.
This change aligns IDEMode/REPL.idr with Idris/REPL.idr which
works as expected.

Relates to:
https://github.com/idris-hackers/idris-mode/pull/563
2022-11-21 10:34:23 +00:00
Tim Engler
811dcd864f Similar to pull request #2136, commit 8ffad8878f
except now packageDirs keeps getting added to. So rather than just
saving and replacing extraDirs, I'm replacing the whole dirs directory
within defs.options
2022-11-21 10:33:56 +00:00
CodingCellist
70ef197cf6
[ base ] Deprecate setByte in favour of setBits8 (#2764)
* [ base ] Deprecate setByte in favour of setBits8
           Deprecate getByte; fix Core.Binary.Prims

Along with `setByte`, the `getByte` function should similarly be
deprecated since it also assumes the value will have the given size,
rather than guaranteeing it in the type.

CI highlighted some required changes in `Core.Binary.Prims` thanks to
`-Werror`. The fix was to add some `cast` calls where the old `getByte`
and `setByte` used to be.

The RefC buffer test will need updating once we remove the functions
completely. Added a note for future peeps.
2022-11-15 10:42:07 +01:00
Denis Buzdalov
f5f7e2eb80 [ error ] Make failing IAlternative w/ FirstSuccess print all errors 2022-11-15 10:28:59 +01:00
Steve Dunham
85c93c8018 [ error ] Add FC for errors on interface constructors (#2769) 2022-11-12 22:17:42 -08:00
Steve Dunham
ea733181c5 [ error ] Add an FC to record constructors for better error messages (#2769) 2022-11-12 21:59:16 -08:00
Gregory Werbin
b81f5280c1 Use consistent punctuation & indentation 2022-11-11 09:33:09 +01:00
Gregory Werbin
c5c842726a Add support for standard C env vars
Also, organize the env var listing a bit more.
2022-11-11 09:33:09 +01:00
Mathew Polzin
25388ecac2 look for lib folders in package directories. 2022-11-04 18:10:03 -05:00
Thomas E. Hansen
dc1662ddf1 [ doc ] Add :doc for unquotes
Co-authored-by: stefan-hoeck <hock@zhaw.ch>
2022-11-04 14:03:21 +00:00
Stefan Höck
b5decdf729
[ new ] add --ttc-version command (#2752)
* [ new ] add --ttc-version command

* [ fix ] -v should still print version
2022-11-04 06:45:49 +00:00
Andy Lok
ddcbe795c6
[ fix ] DISallow grouping pi with different types (#2680)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-11-02 14:33:19 +00:00
Stefan Höck
9c9ffe4a31
[ fix ] isue 2745 (#2747)
* [ fix ] .ipkg install dir

* [ test ] .ipkg install dir

* [ doc ] update CHECKLIST

* [ doc ] add explanation to pkg016 test

* [ cleanup ] no need to clutter CHECKLIST
2022-11-02 12:01:19 +00:00
Zoe Stafford
078445b178
Merge pull request #2744 from dunhamsteve/bang-fc
[ parser ] Better error messages for type mismatch on bang expressions
2022-11-02 07:06:11 +00:00
Steve Dunham
3c0eadee07 [ parser ] Better error messages for type mismatch on bang expressions 2022-11-01 20:18:33 -07:00