Commit Graph

802 Commits

Author SHA1 Message Date
Zoe Stafford
d82c5d633f
Merge pull request #2815 from mjustus/test_pkg017_ignore
[ cleanup ] ignore generated file
2022-12-22 15:02:50 +00:00
Guillaume Allais
1092804726 [ fix #2821 ] Failing blocks should force delayed holes 2022-12-21 11:16:26 +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
5718be2b45 [ cleanup ] ignore generated file 2022-12-12 14:47:33 +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
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
fcbd9e9190
[ fix #2794 ] Do not ignore notinline lets in identity detection (#2795) 2022-12-06 11:41:30 +00:00
Steve Dunham
f443723f4e [ parser ] fix issue where indentation is not checked in record parameters 2022-11-25 08:22:37 +00:00
Steve Dunham
56a9bc6be4 [ error ] Improve locality of parse errors in implicit arguments 2022-11-21 10:40:40 +00:00
Tim Engler
bff18428b4 Added seqL to Control.App and updated docs to fix #2761
Also updated test real002 to use the actual Control.App from
libs/base/Control/App.idr. Before it was using a different version that
existed within its test directory, tests/idris2/real002/Control/App.idr
2022-11-21 10:39:43 +00: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
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
G. Allais
19d0cbcd37
[ new ] put TTC files in a version-tagged directory (#2684) 2022-11-01 18:11:18 +00:00
Edwin Brady
e125c9014f
Prepare release 0.6.0 (#2733)
* Prepare release 0.6.0

* Fix bootstrap chez

* Correct version in bootstrap chez
2022-10-27 16:32:16 +01:00
Guillaume Allais
542ebeae97 [ fix 2726 ] more peeling of Erased 2022-10-22 10:07:39 +01:00
CodingCellist
47c2de3148
[ repl ] Add the ability to get detailed help, e.g. :help :help (#2722)
A common issue for users is that the behaviour of the various repl
commands are not documented anywhere despite some of them having complex
behaviour (e.g. `:set` which accepts a specific set of options). This
implements the ability to call `:?|:h|:help` on repl commands to request
detailed help for a specific repl command, while preserving the
behaviour that calling the help command without any arguments prints the
general help text.

Generic help is defined as the first line of the help text.
Detailed help is defined as the entire help text.

This means that `:help :t`, for example, does not error (there is no
detailed help) but instead just prints the single line of help text.

* [ repl ] Use unlines for detailed help (see #2087)

  Ideally, the lines affected should be multiline strings. But for some
  arcane reason, newlines in those get swallowed in Nix and Windows
  **CI** only Ô.o
  This was already documented in issue #2087.

* [ new ] --except for golden testing lib

  To allow CI to pass despite #2087

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-10-21 14:35:33 +02:00
Guillaume Allais
a39783be8e [ fix #2721 ] Don't reflow doc lines
I don't think there's a good solution at least until we start
parsing these comments so let's just keep them as they were written
by the library writer.
2022-10-19 09:09:11 +01:00
QDelta
e0a19aa01e
[ fix #2719 ] --only behavior in Test.Golden (#2720)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-10-18 12:36:09 +01:00
G. Allais
51d00638b0
[ cosmetic ] Say when you start compiling the executable (#2714) 2022-10-14 16:21:19 +01:00
G. Allais
30866fa892
[ new ] do not split on dotted patterns (#2706) 2022-10-14 16:21:06 +01:00
Steve Dunham
b15be4a70a [ new ] Allow forward declarations of records 2022-10-14 14:58:29 +01:00
CodingCellist
bb602643b1
[ fix #2712 ] Don't consider CyclicMeta recoverable (#2713) 2022-10-14 14:57:55 +01:00
Thomas E. Hansen
6823915dd0 [ tests ] Check REPL help text and module import cmds
The help text check is for making sure we update it when modifying
things, more than anything else.
2022-10-13 11:31:05 +02:00
Denis Buzdalov
3ca065b85d [ fix #2088 ] Make %runElab expression propagate its rig to check 2022-10-07 10:55:22 +02:00
G. Allais
1f3809c49a
[ re #2675 ] Do not build libs/{contribs,papers} during bootstrap (#2677)
Co-authored-by: Ben Hormann <benhormann@users.noreply.github.com>
2022-10-04 13:37:45 +01:00
Steve Dunham
f03f184af9 [ parse ] Add fc to IPragma for better error messages 2022-09-25 16:09:53 +01:00
Guillaume Allais
5631608782 [ base ] deriving Foldable 2022-09-24 10:20:25 +01:00
CodingCellist
7f0dad21f8
[ debug ] Log when stuck because fn out of scope (#2673)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-09-22 13:12:47 +01:00
Guillaume Allais
2adc3319f6 [ parse ] better error messages for records 2022-09-22 12:25:20 +01:00
Steve Dunham
1142f73e05 Add indentation checks when parsing args in implDecl 2022-09-20 23:57:54 +01:00
Steve Dunham
03d6c5f637
[ new ] Handle forward declarations of implementations (#2668)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2022-09-20 21:08:50 +01:00
Steve Dunham
669f49e23e [ parser ] Make commitKeyword fail fatally 2022-09-16 11:39:53 +01:00
G. Allais
55926f30c5
[ fix #2655 ] Add support for DataOpts in records (#2658) 2022-09-14 14:57:04 +01:00
Zoe Stafford
02dfd6ff6c
Trans deps v3 (#2584)
* make `depends` collect all transitive dependencies

This happens by installing the (modified) ipkg file along with ttc files

* [ fix ] parsing a package shouldn't always set sourceDir

* linter *sigh*

* Fix test, add changelog

`asDepends` has been changed to `setSrc` as that is for me more intuitive

in idris2/pkg006 the version field was removed from the ipkgs of bar-baz and quux
as idris now expects the version to match the folder

idris2/pkg010 explicitly disables incremental compilation, to prevent extra log info

* (hopefully) fix idris2/pkg13 test on windows

* Actually install the version
This should make things start working

* [ fix ] use backtracking to resolve transitive dependencies

* [ fix ] use backtracking to resolve dependencies

* [ fix ] test pkg006

* Fix missing import

Co-authored-by: stefan-hoeck <hock@zhaw.ch>
2022-09-09 07:08:39 +01:00
Zoe Stafford
a001333947
Warning for shadowed local bindings (#2623)
* Warning for shadowed local bindings

* [ lint ]

* Remove name shadowing in compiler src

* [ fix ] spelling & test cases

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-09-07 20:59:28 +01:00
Steve Dunham
9646b31f2b [ test ] Fix timing issue in interactive045 test 2022-09-06 10:05:34 +01:00
G. Allais
ece1198074
[ fix #1742 ] Do not use uppercase names as pattern variables (#2642) 2022-09-05 12:45:51 +01:00
Steve Dunham
351b5ba720 [ parser ] Fix issue where Alt drops incoming commit tag 2022-09-05 12:44:02 +01:00
Steve Dunham
2e45902048 [ parser ] Better error messages inside if statements. 2022-09-05 12:44:02 +01:00
Steve Dunham
150673622b [ test ] Add a sleep 1 to the interactive044 test to work around a race condition 2022-09-04 09:17:22 +01:00
Guillaume Allais
f678043854 [ test ] add tricky test case ported from Agda 2022-09-02 16:06:40 +01:00
Guillaume Allais
552f27f813 [ fix #2640 ] Do not shadow function name during case split 2022-09-02 11:55:15 +01:00
Guillaume Allais
6891490ed2 [ fix ] support for implicits in Deriving.Functor
A lot of refactoring to bring these. That's hopefully the last
feature that was needed...
2022-08-29 18:35:24 +01:00
Mathew Polzin
23e3695d74 Add test for auto implicit case splitting. 2022-08-16 09:23:19 +02:00
Guillaume Allais
4672305fc3 [ fix ] more filtering of invalid datatypes 2022-08-13 11:29:19 +01:00
Justus Matthiesen
a30209d492
[ fix ] Remove stray ")" in Show instance for Term (#2611) 2022-08-08 15:24:07 +01:00
G. Allais
84a504738c
[ doc ] add comments to generated javascript (#2594) 2022-07-18 17:30:56 +01:00
Guillaume Allais
8ecb1aaf95 Revert "Fix issue with case inside a type."
This reverts commit 50ca28c068.
2022-07-18 15:58:29 +01:00
Steve Dunham
50ca28c068 Fix issue with case inside a type. 2022-07-18 14:17:14 +01:00
G. Allais
0cbbf97b79
[ new ] extend Deriving.Functor to (non-strictly) positive functors (#2591) 2022-07-18 14:10:46 +01:00
G. Allais
1f41c8b44d
[ close #647 ] Already fixed (#2581) 2022-07-08 14:16:25 +01:00
Guillaume Allais
ac2ef882f6 [ fix #2573 ] Solve constraints before looking at eq type 2022-07-07 20:36:05 +01:00
Guillaume Allais
19bc798952 [ re #2526 ] Update golden value 2022-07-07 20:34:54 +01:00
Guillaume Allais
d19dbfffff [ fix #2229 ] better warning 2022-07-07 16:42:34 +01:00
G. Allais
4874bf2114
[ fix ] handle implicit arguments in Deriving.Functor (#2572) 2022-07-07 09:55:13 +01:00
Stefan Höck
5a962929e7
[ fix ] issue 2537 (#2538)
Co-authored-by: Zoe Stafford <zoepolarsax@gmail.com>
2022-07-07 09:54:52 +01:00
Guillaume Allais
7db20d38a3 [ cleanup ] Fewer assert_total in deriving Functor 2022-07-04 12:03:49 +01:00
G. Allais
aeeb338e6c
[ new ] deriving Functor (#2568) 2022-07-04 08:58:18 +01:00
Ruslan
dbba32ea09
Fix an eta issue in elaborator-reflection (#2449)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: Denis Buzdalov <public@buzden.ru>
2022-06-30 22:01:31 +01:00
G. Allais
4024857d20
[ base ] Various Language.Reflection improvements (#2554) 2022-06-22 13:07:27 +01:00
Guillaume Allais
e5802204b6 [ fix ] holes in record types 2022-06-17 10:17:40 +01:00
Guillaume Allais
2060535d08 [ new ] name hints for primitive types 2022-06-14 16:07:37 +01:00
Guillaume Allais
7bd7f1da9c [ fix ] resugaring of DPair 2022-06-08 22:44:55 +01:00
György Kurucz
79a2f677d4 [ re #1282 ] Improve unelaboration of case expressions 2022-06-08 17:01:36 +01:00
Zoe Stafford
b9001439b3 Revert "Transitive dependencies v2 (#2496)"
This reverts commit 51f952714d.
2022-06-08 06:35:39 +01:00
Zoe Stafford
51f952714d
Transitive dependencies v2 (#2496)
* make `depends` collect all transitive dependencies

This happens by installing the (modified) ipkg file along with ttc files

* [ fix ] parsing a package shouldn't always set sourceDir

* linter *sigh*

* Fix test, add changelog

`asDepends` has been changed to `setSrc` as that is for me more intuitive

in idris2/pkg006 the version field was removed from the ipkgs of bar-baz and quux
as idris now expects the version to match the folder

idris2/pkg010 explicitly disables incremental compilation, to prevent extra log info

* (hopefully) fix idris2/pkg13 test on windows

* Actually install the version
This should make things start working
2022-06-07 14:31:14 +01:00
Denis Buzdalov
599027a893 [ fix ] Make able to interpret result of a macro as a function 2022-05-27 09:36:44 +01:00
G. Allais
607a2a2110
[ IDE ] refine command (#2490) 2022-05-25 11:29:03 +01:00
Zoe Stafford
932a24baa1 Revert "make depends collect all transitive dependencies (#2469)"
This reverts commit fde6269c7e.
2022-05-21 06:49:07 +01:00
Zoe Stafford
fde6269c7e
make depends collect all transitive dependencies (#2469)
* make `depends` collect all transitive dependencies

This happens by installing the (modified) ipkg file along with ttc files

* [ fix ] parsing a package shouldn't always set sourceDir

* linter *sigh*

* Fix test, add changelog

`asDepends` has been changed to `setSrc` as that is for me more intuitive

in idris2/pkg006 the version field was removed from the ipkgs of bar-baz and quux
as idris now expects the version to match the folder

idris2/pkg010 explicitly disables incremental compilation, to prevent extra log info

* (hopefully) fix idris2/pkg13 test on windows
2022-05-20 16:20:54 +01:00
Guillaume Allais
7c784dd89c [ fix ] missing rigs in doc type signatures 2022-05-12 10:25:54 +01:00
G. Allais
4256cd15fd
[ highlighting ] case trees in :di (#2440) 2022-04-29 12:52:23 +01:00
Steve Dunham
04e65529f6 Better parse error for missing paren after with 2022-04-29 08:59:40 +01:00
G. Allais
05baf44b5b
[ refactor ] Index Pretty over the type of annotations (#2371) 2022-04-27 12:26:59 +01:00
Guillaume Allais
81ba322a4b Revert "[ fix ] search should solve auto implicits before implicits"
This reverts commit 6dd68e8924.
because of issue #2437
2022-04-27 11:00:51 +01:00
Guillaume Allais
6dd68e8924 [ fix ] search should solve auto implicits before implicits 2022-04-26 15:07:51 +01:00
G. Allais
98b1062772
[ fix ] :printdef support for P(D)Pair & Equal (#2416) 2022-04-15 20:39:46 +01:00
Guillaume Allais
ec4cf3d48c [ fix ] pretty printing of misspellings 2022-04-15 20:18:48 +01:00
Guillaume Allais
0986cf177b [ parse ] better error message for list literals
I got fed up with being puzzled whenever edwin's trailing commas
and my leading commas clash and the error location is the opening
square bracket rather than the repeated comma.
2022-04-15 11:33:20 +01:00
Guillaume Allais
e0f5f541e2 [ fix #2402 ] Check totality before exiting failing block 2022-04-08 13:21:46 +01:00
Guillaume Allais
55d6c50706 [ fix ] make 'failing' whitespace-insentitive 2022-04-07 13:59:27 +01:00
G. Allais
79e733b848
[ new ] multi-with elaborated as nested withs (#2403) 2022-04-07 09:30:23 +01:00
Thomas E. Hansen
a644a85a57 [ base ] public export quantifier functions 2022-04-04 13:24:12 +02:00
G. Allais
4b6936d615
[ fix ] allow refined implicit patterns in with clauses (#2393) 2022-04-03 10:45:29 +01:00
Guillaume Allais
ad78457869 [ fix ] location information in with clauses 2022-04-01 11:41:48 +01:00
Guillaume Allais
bc9a319ddf [ parser ] bunched args in implementation implicits 2022-03-31 15:46:44 +01:00
Denis Buzdalov
2538b1e82b
[ syntax ] Require indent for blocks like mutual and failing (#2387) 2022-03-31 12:54:38 +01:00
Denis Buzdalov
03f23b0457 [ error ] Improve the indented non-empty block's error message 2022-03-31 10:44:06 +01:00
Guillaume Allais
921d3b7b50 [ parser ] better error messages for Haskellers 2022-03-31 10:43:46 +01:00
G. Allais
2aa0069e63
[ doc ] also display definition's visibility (#2374) 2022-03-24 23:11:10 +00:00
Denis Buzdalov
e8d3d788c1
[ base ] Add some more properties, functions and interface implementations (#2361) 2022-03-23 13:33:13 +00:00
Giuseppe Lomurno
f38feaa48d Clean path in more Core.Directory functions 2022-03-23 12:49:36 +00:00
G. Allais
35b2362487
[ new ] failing blocks (#2360) 2022-03-23 12:01:13 +00:00
Ohad Kammar
319c7f7b86
Move Syntax.PreorderReasoning into base (#2368) 2022-03-22 20:58:36 +00:00
G. Allais
0dfa7d8d79
[ doc ] prettier :di (#2356) 2022-03-18 08:45:18 +00:00
Denis Buzdalov
05d64483f6 [ refactor ] Factor out a type for primitive types out of Constant 2022-03-10 23:07:20 +00:00
Guillaume Allais
14f2196d15 [ doc ] return module header docs 2022-03-09 13:31:30 +00:00
G. Allais
1c396744d9
[ doc ] :printdef for interface implementations (#2340) 2022-03-07 11:47:20 +00:00
Jan de Muijnck-Hughes
4ba3bb6670
[ fix ] Literate things (#2312)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2022-02-18 11:29:52 +00:00
Balazs Komuves
3345460fe9
[ fix #2176 ] Records in where-blocks are in the wrong namespace (#2187) 2022-02-16 15:43:50 +00:00
Guillaume Allais
bec4a0a88e [ re #499 ] quantity-aware with-clauses 2022-02-09 09:19:40 +00:00
madman-bob
0ee9632e45
[ refactor ] Abstract Prelude.elem to work with all Foldables (#2294) 2022-02-01 21:34:29 +00:00
Stefan Höck
f1d56a4e0f
[ syntax ] Namespaced idiom brackets (#2284) 2022-01-24 16:18:36 +00:00
Mathew Polzin
35a84e505d
[fix #2033] determining when to rebuild modules (#2188) 2022-01-21 10:26:20 +00:00
Mathew Polzin
e7ed760016
[ new ] optional language version field to ipkg files. (#2256) 2022-01-20 10:05:53 +00:00
MarcelineVQ
6d10ca09b4 [ base ] add Show for Ordering 2022-01-19 22:12:36 +00:00
Robert Wright
76d1936fad Add Singleton type 2022-01-19 14:22:40 +00:00
Vincent de Haan
3a38424e69 Minor fix in documentation 2022-01-11 22:36:22 +01:00
Jason Dagit
1d7207fe05
[ fix #2202 ] Use SnocList in parser state to avoid quadratic slowdown (#2203)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-01-11 16:06:19 +00:00
teggot
d3aed0404c
[ fix #1959 ] use modern record update syntax (#2196) 2021-12-16 18:23:18 +00:00
Balazs Komuves
3463adbc48
[ fix #2032 ] Slow typechecking on Int operation when Data.Fin.fromInteger is in scope (#2189) 2021-12-13 13:47:53 +00:00
Balazs Komuves
6cc20a9974
[ fix #2138] Add an %unhide pragma (#2181)
* add %unhide pragma

* add a test case

* clean up

* more consistent English usage (+fix some typos)

* add a warning for unhiding not-already-hidden names

* move `unhide` (and `hide`) to the bottom of the source file to avoid having to forward-declare `recordWarning`
2021-12-11 18:03:36 -08:00
Balazs Komuves
c3ec522077
[ fix #1404 ] Totality annotation for data type definitions (#2179)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: stefan-hoeck <hock@zhaw.ch>
2021-12-08 16:08:26 +00:00
Balazs Komuves
e511bc6884
[ fix #2098 ] Allow unclosed comment blocks (#2173) 2021-12-07 15:46:38 +00:00
Balazs Komuves
5e775aaa41
[ fix #1945 ] Add default support for record fields (#2175) 2021-12-06 21:21:42 +00:00
Balazs Komuves
3f3912e934
[ fix #2065 ] Use postfix projections if prefix ones are off (#2169) 2021-12-06 18:14:13 +00:00
Guillaume ALLAIS
32140f577f [ fix ] resugaring of snoc lists 2021-12-02 12:49:07 +00:00
G. Allais
059f74ad0b
[ fix #1861 ] rewrite_impl is linear (#2150) 2021-11-25 17:07:05 +00:00
Guillaume ALLAIS
500df117c1 [ fix #1741 ] Do not replace names in as-patterns 2021-11-25 16:04:44 +00:00
Guillaume ALLAIS
56e599de9c [ re #1987 ] test case 2021-11-25 15:12:54 +00:00
Guillaume ALLAIS
662f1eabc5 [ re #215 ] test case 2021-11-24 20:28:07 +00:00
Guillaume ALLAIS
63bf9f2900 [ re #1852 ] Partial fix without the Hole UN refactoring 2021-11-24 10:54:32 +00:00
Denis Buzdalov
ab3862798b [ fix ] Use right reflection constructor name for unambiguing with 2021-11-23 16:42:51 +00:00
claymager
283f9bd00f
[ fix ] Forbid "." as namespace identifier (#2134) 2021-11-22 12:13:08 +00:00
Guillaume ALLAIS
0bc18bd34a [ fix #2072 ] correctly handle fixity in printer 2021-11-19 17:42:07 +00:00
Guillaume ALLAIS
f99b875d7e [ fix #2095 ] error on duplicated updates 2021-11-19 16:30:35 +00:00
G. Allais
489e8c7cbc
[ re #2038 ] doc for reserved symbols (#2126) 2021-11-18 18:13:20 +00:00
Mathew Polzin
0eba4c691e
Add %deprecate pragma (#2086) 2021-11-17 10:41:03 +00:00
André Videla
9e6678e3d3
Merge pull request #2102 from madman-bob/list-singleton
Add List singleton function
2021-11-10 00:46:40 +00:00
Edwin Brady
2f6ec76223
Get information about names in reflection (#2110)
* Only normalise a search goal if it's fast

While we do end up normalising it anyway on success, there might be
things blocking it that make the intermediate terms very big, so only do
it speculatively to see if it's quick.

* Get information about names in reflection

Currently this is only whether it's a function, or data or type
constructor. I expect more may be useful/possible.
2021-11-07 15:06:53 +00:00
Robert Wright
921bc24a2a Add List singleton function 2021-11-05 16:08:54 +00:00
G. Allais
668c221474
[ re #2032 ] faster version of fromInteger (#2090) 2021-11-02 17:43:01 +00:00
G. Allais
15cc8243f7
[ re #2001 ] Make some prelude interfaces total (#2083)
The prelude interfaces that have default definitions for all of
their fields are declared total so that users are forced to think
about meeting the minimal requirements for an implementation to be
valid.
2021-11-02 15:34:52 +00:00
Edwin Brady
d531cc8dea
Cumulativity preparation: Add field for universe level to TType (#2076)
* Add field for universe level to TType

This doesn't do anything yet, other than introduce new universe
variables whenever we introduce a new type, but it's the first step
towards checking the universe hierarchy. Next step is to add constraints
when checking pi, unifying/converting types, and when adding data
constructors.

* TTC version increment

Thought I'd done this, but apparently I didn't save the file. Oops!

* Add structure for universe constraints

* Fix display of ambiguity errors

We need to store the Context in errors at the point where the error
occurs, or we might get some nonsense in the message. There's still a
couple of places in Error where we don't do this right. This fixes one
of them, and improves a few messages in the process.
2021-10-31 00:00:16 +01:00
Edwin Brady
2df3ecc2e3
Fix display of ambiguity errors (#2075)
We need to store the Context in errors at the point where the error
occurs, or we might get some nonsense in the message. There's still a
couple of places in Error where we don't do this right. This fixes one
of them, and improves a few messages in the process.
2021-10-30 23:08:53 +01:00
Guillaume ALLAIS
a8d5e005e1 [ fix #2070 ] Look under MaybeMispelling when failing quickly 2021-10-29 17:57:55 +01:00
G. Allais
ac7a4644b8
[ fix #2046 ] only refold positive integers as nats (#2064) 2021-10-26 17:16:31 +01:00
Ellis Kesterton
9c2ce646f9
[ fix #2002 ] implicits used in record update (#2007) 2021-10-26 17:15:29 +01:00
CodingCellist
4a1bb310a7
[ fix #1175 ] case-splitting for inline case blocks (#2010) 2021-10-26 15:51:52 +01:00
Alissa Tung
1bd81dfbbb
[ fix #2053 ] do not show ambiguous private names (#2056)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-10-26 15:51:34 +01:00
G. Allais
b9834978cb
[ re #2041 ] better runtime error for holey expression (#2045) 2021-10-26 12:43:39 +01:00
Giuseppe Lomurno
7f63a0103f Add user hints to expression search 2021-10-24 10:24:22 +01:00
Guillaume ALLAIS
8fde63396e [ fix #1626 ] Empty lines are still lines 2021-10-21 16:00:50 +01:00
Daniel Kröni
aa107a9754
Implemented %noinline (#2027)
* Implemented %noinline

* Removed trailing spaces.

* Added missing case in Reify FnOpt

* Added error message when both %inline and %noinline are set.

* Added test.

* Changed from perror to error
2021-10-19 15:22:36 +01:00
Edwin Brady
75716cd0d1
Fix casts in scheme evaluator (#2011)
* Fix casts in scheme evaluator

We really need test cases for all the primitives before we can use this
evaluator properly. Also test cases that run inside an environment,
which are a bit harder to construct.

* Add the cast fixes to racket support code

* More racket compile time evaluation fixes

We had the chez version of some primtives in the ct-support file. We
need a full set of tests for the primitives here too...
2021-10-16 14:19:26 +01:00
Edwin Brady
cfb7395eac
Add try primitive to reflection library (#2008) 2021-10-16 11:24:12 +01:00
Guillaume ALLAIS
1877e66309 [ new ] log sugared term Elab primitive 2021-10-14 14:16:14 +01:00
G. Allais
00ab9573a5
[ re #1944 ] Allow toplevel aliases (#1952)
* [ re #1944 ] Allow simple toplevel aliases
* [ done ] toplevel aliases with arguments
* [ fix ] weird nonsensical test case
* [ fix ] golden test files
2021-10-13 21:55:23 +01:00
André Videla
274954998b
Implement generic interpolation (#1967)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-10-13 17:26:54 +01:00
Guillaume ALLAIS
a507b6dadf [ new ] better docstrings for primitives 2021-10-13 13:17:48 +01:00
Guillaume ALLAIS
d1041cf786 [ more ] Hints for primitive types too! 2021-10-13 13:17:48 +01:00
Guillaume ALLAIS
7ebaa23439 [ new ] list hints attached to a data type 2021-10-13 13:17:48 +01:00
Edwin Brady
dd95a549d5
Fix performance regression #1991 (#1995)
* Normalise types fully at the REPL

It was a bit odd that we only normalised the scope of function types and
not the arguments, and I can't remember the reason for that if there
even was one.

* Better way of using nf_metavars_threshold

If a term is getting big and probably needs normalising, we now have a
sizeLimit flag in quote, so we can use that instead of checking the size
afterwards. This is a handy heuristic for speeding up unification when
there's a term with lots of suspended computation. Fixes #1991
2021-10-11 23:53:52 +01:00
Alissa Tung
e15c78ce9e
[ fix #1970 ] error on mod self ref (#1977) 2021-10-08 10:09:17 +01:00
Zoe Stafford
d4263441b7
[ new ] Some optimisations mainly involving Nat and Fin (#1817)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-10-07 19:21:32 +01:00
Guillaume ALLAIS
0a29d06fea [ fix ] test runner 2021-10-07 16:07:03 +01:00
Guillaume ALLAIS
384c8874c2 [ fix #1979 ] use virtualised locs rather than EmptyFCs
For error reporting purposes it's better to have an (approximate)
virtual location for code that was introduced by the elaborator
than to have an `EmptyFC` that does not help.
2021-10-07 16:07:03 +01:00
G. Allais
7936bf77d7
[ fix #1744 ] Compare names by root rather than UserName (#1975) 2021-10-05 15:06:16 +01:00
Mathew Polzin
ebc340c41e
Merge pull request #1961 from attila-lendvai/fix-test-pkg010
[tests] fix idris2/pk010: make it more roboust
2021-10-03 08:04:31 -07:00
Mathew Polzin
7b19099763
print location of implicit name shadowing with the warning. (#1968)
* print location of implicit name shadowing with the warning.

* move location output to bottom of warning.
2021-10-03 10:15:01 +01:00
Mathew Polzin
fa06e9936b
Warn about unreachable default clauses (#1942)
* so much experimentation

* tests that show preliminary evidence the new stuff is working.

* small amount of cleanup

* more cleanup of various troubleshooting code.

* new test case added.

* only log unreachable indices if there are any.

* when traversing deeper simply skip over defaults since they have already been reviewed.

* Remove fallback clause that the changes in this PR correctly identified as unreachable.

* tidying up more.

* move some common functions to a new Core.Case.Util module.

* refer to case builder and case tree under new parent module.

* update imports to look for CaseTree in new submodule.

* update api ipkg

* remove unneeded application operators.

* remove or comment out unreachable default clauses caught by the changes in this PR.

* a bit of code documentation and renaming for clarity.

* bump previous version in CI.

* fix API usage of Util module.

* Add issue 1079 test cases.

* forgot to add new test cases file.

* remove commented-out lines by request of RefC author.

* Use a SortedSet instead of nubbing a list.

* update new case tree import.

* Update src/Core/Case/Util.idr

Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>

* remove function with nothing to offer above and beyond a differently named copy of the same code.

* replace a large tuple with a record; discover not all of the tuple's fields were needed.

* fix shadowing warning.

Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2021-10-02 12:55:21 +01:00
Attila Lendvai
e15a859613
[tests] fix idris2/pk010: make it more roboust 2021-09-29 18:42:20 +02:00
Edwin Brady
a9ccf4db4f
Experimental Scheme based evaluator (#1956)
This is for compiled evaluation at compile-time, for full normalisation. You can try it by setting the evaluation mode to scheme (that is, :set eval scheme at the REPL). It's certainly an order of magnitude faster than the standard evaluator, based on my playing around with it, although still quite a bit slower than compilation for various reasons, including:

* It has to evaluate under binders, and therefore deal with blocked symbols
* It has to maintain enough information to be able to read back a Term from the evaluated scheme object, which means retaining things like types and other metadata
* We can't do a lot of the optimisations we'd do for runtime evaluation particularly setting things up so we don't need to do arity checking

Also added a new option evaltiming (set with :set evaltiming) to display how long evaluation itself takes, which is handy for checking performance.

I also don't think we should aim to replace the standard evaluator, in general, at least not for a while, because that will involve rewriting a lot of things and working out how to make it work as Call By Name (which is clearly possible, but fiddly).

Still, it's going to be interesting to experiment with it! I think it will be a good idea to use it for elaborator reflection and type providers when we eventually get around to implementing them.

Original commit details:

* Add ability to evaluate open terms via Scheme

Still lots of polish and more formal testing to do here before we can
use it in practice, but you can still use ':scheme <term>' at the REPL
to evaluate an expression by compiling to scheme then reading back the
result.

Also added 'evaltiming' option at the REPL, which, when set, displays
how long normalisaton takes (doesn't count resugaring, just the
normalisation step).

* Add scheme evaluation mode

Different when evaluating everything, vs only evaluating visible things.
We want the latter when type checking, the former at the REPL.

* Bring support.rkt up to date

A couple of missing things required for interfacing with scheme objects

* More Scheme readback machinery

We need these things in the next version so that the next-but-one
version can have a scheme evaluator!

* Add top level interface to scheme based normaliser

Also check it's available - currently chez only - and revert to the
default slow normaliser if it's not.

* Bring Context up to date with changes in main

* Now need Idris 0.5.0 to build

* Add SNF type for scheme values

This will allow us to incrementally evaluate under lambdas, which will
be useful for elaborator reflection and type providers.

* Add Quote for scheme evaluator

So, we can now get a weak head normal form, and evaluate the scope of
a binder when we have an argument to plug in, or just quote back the
whole thing.

* Add new 'scheme' evaluator mode at the REPL

Replacing the temporary 'TmpScheme', this is a better way to try out the
scheme based evaluator

* Fix name generation for new UN format

* Add scheme evaluator support to Racket

* Add another scheme eval test

With metavariables this time

* evaltiming now times execution too

This was handy for finding out the difference between the scheme based
evaluator and compilation. Compilation was something like 20 times
faster in my little test, so that'd be about 4-500 times faster than the
standard evaluator. Ouch!

* Fix whitespace errors

* Error handling when trying to evaluate Scheme
2021-09-24 20:38:55 +01:00
Guillaume ALLAIS
f4bd911f13 [ fix #1943 ] Allow operator names in named argument applications 2021-09-23 11:41:25 +01:00
Edwin Brady
bf0a157253
Disable -Xcheck-hashes, at least for the moment (#1940)
* Version increment to 0.5.1

This is to remove the requirement on Chez >9.5

* Disable -Xcheck-hases, at least for the moment

If we're going to have this as an option, we need to have a portable way
of finding a sha256sum command. At the moment, we might find a command,
but different versions accept different options. We should at least
allow setting it via an environment variable, and we certainly shouldn't
fail if running the command fails.

* Update bootstrap code ready for 0.5.1 release
2021-09-20 07:51:33 +01:00
Edwin Brady
1e90182311
Version increment to 0.5.1 (#1939)
This is to remove the requirement on Chez >9.5
2021-09-19 20:53:32 +01:00
Guillaume ALLAIS
87c1cb697f [ repl ] better printing of holes
* Fixed printing in the IDEMode (& include highlighting)
* Now also print the type of the holes
2021-09-19 17:49:51 +01:00
Edwin Brady
2e98dd6dab
Abandon auto search on undefined name (#1938)
* Abandon auto search on undefined name

These might arise from names in other modules that haven't been
imported. But it's going to be an error whatever, so give up straight
away. Fixes #1925

* Fix typo

* Fix test source

* Record possible cause when we can't solve a goal

Normally, it's just because we searched and failed. But maybe sometimes,
it's because there's an undefined name, in which case, we can include
this in the error message.

This is good to record because it means we don't abandon elaboration at
the wrong time! Say, if a search fails due to an undefined name, but it
was only in one branch of an ambiguous elaboration.

* Add necessary arguments for perf009 test
2021-09-19 14:31:29 +01:00
Edwin Brady
ada3eb4449
Version 0.5.0 (#1931)
* Update version numbers and bootstrap scheme

* Use wall clock time for search timeouts

That was always the intention in any case, rather than the process time.
2021-09-18 16:07:34 +01:00
G. Allais
8b9916f5b1
[ html ] Various HTML docs fixes (#1924) 2021-09-15 18:41:37 +01:00
G. Allais
32e26c5bd1
[ refactor ] introduce UserName for (UN/RF) (#1926)
Instead of having UN & RF (& Hole in the near future & maybe even
more later e.g. operator names) we have a single UN constructor
that takes a UserName instead of a String.

UserName is (for now)

```idris
data UserName : Type where
  Basic : String -> UserName -- default name constructor       e.g. map
  Field : String -> UserName -- field accessor                 e.g. .fst
  Underscore : UserName      -- no name                        e.g. _
```

This is extracted from the draft PR #1852 which is too big to easily
debug. Once this is working, I can go back to it.
2021-09-15 13:20:58 +01:00
Tim Engler
7baf698f66
Made unifying error msg nicer. (#1922)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-09-15 11:57:50 +01:00
Guillaume ALLAIS
1f85265193 [ re #1632 ] (->) does not unify with any of TCon/Type/PrimVal 2021-09-09 18:37:49 +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
Guillaume ALLAIS
257783275e [ new ] --total cli flag 2021-09-03 12:07: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
G. Allais
1e0027721f
[ fix #1859 ] Undo my mistakes (#1866) 2021-08-27 16:18:24 +01:00
G. Allais
e2addcf27d
[ new ] semantic highlighting via the IDE mode (#1868) 2021-08-27 14:47:35 +01:00
Guillaume ALLAIS
4a9f00078a [ close #1313 ] test case
This was fixed by, I believe, the addition of `withExtendedNS` in #1342
2021-08-20 16:47:59 +01:00
G. Allais
8d8a135237
[ fix #1496, fix #1345 ] propagate lex & lit fails too (#1850) 2021-08-20 16:47:47 +01:00
Guillaume ALLAIS
58907de84b [ new ] specify data/record/interface 2021-08-20 14:43:07 +01:00
G. Allais
c1ebc0535d
[ new ] semantic highlighting in REPL & holes (#1836) 2021-08-13 16:00:54 +01:00
G. Allais
21c6f4fb79
[ breaking ] remove parsing of dangling binders (#1711)
* [ breaking ] remove parsing of dangling binders

It used to be the case that

```
ID : Type -> Type
ID a = a

test : ID (a : Type) -> a -> a
test = \ a, x => x
```

and

```
head : List $ a -> Maybe a
head [] = Nothing
head (x :: _) = Just x
```

were accepted but these are now rejected because:

* `ID (a : Type) -> a -> a` is parsed as `(ID (a : Type)) -> a -> a`
* `List $ a -> Maybe a` is parsed as `List (a -> Maybe a)`

Similarly if you want to use a lambda / rewrite / let expression as
part of the last argument of an application, the use of `$` or parens
is now mandatory.

This should hopefully allow us to make progress on #1703
2021-08-10 19:24:32 +01:00
Ellis Kesterton
0d6049cbcf
Fix error message for incorrect function patterns (#1816) 2021-08-09 10:00:34 +01:00
Edwin Brady
170af1e87a
Use Closures instead of NF in binders for normal forms (#1823)
* Skip forced arguments in conversion check

This isn't always safe - we have to have also checked the type of the
things we're converting - but in the place where it is safe it can be a
pretty significant saving.

* Use Closures, not NF, in Binders for normal forms

This means we don't need to reduce argument types during unification if
we don't need to. Also, we now try to avoid reducing closures during
unification if they are unified with a metavariable. Together, this
saves a huge amount of unnecessary evaluation in programs that do a lot
of compile time evaluation.

* Didn't mean to update idris2api.ipkg

* Fix dodgy merge
2021-08-08 17:05:29 +01:00
Zoe Stafford
1669fc351b
Refactor %builtin (#1803)
* Stub for future 'identity' optimisation
I plan to add this later, but I'm using for now for
NaturalToInteger and IntegerToNatural

* Refactor `%builtin`
fixes #1799

- automatically optimise all Natural shaped things
- NaturalToInteger and IntegerToNatural now use
  new `Identity` flag (internal use only for now)
  which signals the function is identity at runtime

* Use NaturalToInteger and IntegerToNatural for Nat and Fin
Also define show fin in terms of finToInteger, for speed

* Fix name handling for %builtin

* [ tests ] fixes + #1799

* remove %builtin from libs
Add back after next version

* Use resolved names where convenient
2021-08-03 14:19:17 +01:00