Commit Graph

949 Commits

Author SHA1 Message Date
Edwin Brady
f7161cc76b
Merge pull request #237 from petithug/literate-master
Literate programming
2020-03-31 18:19:43 +01:00
Edwin Brady
68b4951d33
Merge pull request #251 from ska80/help-hint
Show a hint for help on the banner
2020-03-31 18:17:56 +01:00
Edwin Brady
31a2c46383
Merge pull request #250 from ziman/fix-cast
Fix runtime error in `the Int (cast "")`
2020-03-31 18:17:23 +01:00
Edwin Brady
7c0581a10a
Merge pull request #245 from ziman/stable-sort
Make `List.sortBy` stable
2020-03-31 18:15:27 +01:00
Edwin Brady
42e56682d8
Merge pull request #244 from ziman/lambda-case
Lambda case
2020-03-31 18:15:15 +01:00
Edwin Brady
04c63b593f
Merge pull request #243 from deviant-forks/intercalate-list
Add `intercalate` for `Data.List`
2020-03-31 18:14:29 +01:00
Edwin Brady
b3dc643029 Better disambiguation of pairs
The names weren't fully explicit in the elaborator, so ambiguity
resolution wasn't able to take advantage of type-directed pruning. Now
they're explicit (but hard-coded, which we should fix later...) so they
can be resolved more easily.
2020-03-31 18:12:34 +01:00
Edwin Brady
aaf07d52ce Depth error are ambiguity errors too
This means we delay ambiguity resolution properly if we hit a depth
error, which means that we can come back to it later and hopefully be
able to resolve it by type on a second attempt.
2020-03-31 16:59:07 +01:00
Edwin Brady
7bbd26618e Credit where it's due!
Add a CONTRIBUTORS file. This is generated from the git logs.
2020-03-31 16:21:04 +01:00
Edwin Brady
b417413a11 Report an error if ambiguities go too deep
This is the most likely cause of type checking being too slow, at least
in cases where there's not too much type level computation, so rather
than explore for ages, give up after going under too many ambiguous
names during elaboration.

The depth limit is configurable, with %ambiguity_depth <level>, but it's
very unlikely you'll ever want to do that rather than disambiguating
explicitly.
2020-03-31 14:51:33 +01:00
Edwin Brady
736699c729 Better ambiguity resolution
Do two passes through delayed elaborators (it's impossible to predict
dependency order). Possibly this should keep going as long as it's
making progress? I'll consider that later.
2020-03-31 13:04:42 +01:00
Kamil Shakirov
b3392ae225 Show a hint for help on the banner 2020-03-31 11:33:42 +06:00
Edwin Brady
ee3011a07f Small improvement in ambiguity resolution
This is a tweak we used in Idris 1: In the end, if there is ambiguity,
and some names generate unification constraints but exactly one doesn't,
take the one that doesn't.
2020-03-31 01:25:37 +01:00
Edwin Brady
65461131fc Better ambiguity errors
If we have lots of delayed elaborators, and more than one fails, we need
to print the name ambiguity error first since that is the most likely
cause of any other errors.
2020-03-31 00:36:32 +01:00
Edwin Brady
7ff1e6275f Allow setting logging mid term
Sometimes this makes debugging easier since the logging is more
localised.
2020-03-30 22:55:08 +01:00
Edwin Brady
6beb6aa7c0 Prioritise resolution of delayed elaborators
'case' goes first, because it might help resolve ambiguities. Ideally
we'd keep retrying delayed elaborators until they work, but that's going
to get slow...
2020-03-30 16:02:23 +01:00
Edwin Brady
b0e55b53eb A bit more library support 2020-03-30 13:06:59 +01:00
Matus Tejiscak
16e027218b Use cond and equal? in destroy-prefix. 2020-03-29 22:26:42 +02:00
Marc Petit-Huguenin
7ea39af60e
Literate programming
- Add support for .lidr files.
- Add new Parse Error for Literate fails.
- Add support for Case Split.
- Add support for Add Clause.
- Add support for Add Lemma.
- Add tests.
2020-03-29 11:58:00 -07:00
Matus Tejiscak
2cadbd2cd1 Fix runtime error in (the Int (cast "")). 2020-03-29 20:33:46 +02:00
Matus Tejiscak
fcdfa8e191 Fix comment. 2020-03-29 19:50:43 +02:00
Matus Tejiscak
9154a9b02b Add comments. 2020-03-29 19:48:00 +02:00
Matus Tejiscak
2b264d0517 Make sortBy stable. 2020-03-29 19:38:54 +02:00
Edwin Brady
5703befb0d Fix ! notation in pattern matching let 2020-03-29 17:28:51 +01:00
Edwin Brady
ca512ad55a Parser fix
'then' and 'else' indicate the end of an expression, which means that we
can now nest if blocks more freely
2020-03-29 16:55:44 +01:00
Edwin Brady
95a90d0a05 Note on %hint in documentation 2020-03-29 13:02:10 +01:00
Matus Tejiscak
ff813ab6dd Add lambda case. 2020-03-29 01:23:15 +01:00
Edwin Brady
725e5ac13d No need to store names with locals in TTC
This is needed for consistency with the self hosted version (where the
names aren't even available at that point - so it turns out we learn
something from erasability :))
2020-03-28 20:22:52 +00:00
Marshall Bowers
5b1e8bf436 Add intercalate for Data.List 2020-03-28 13:18:51 -04:00
Edwin Brady
41ec1fc587 Minor documentation edits 2020-03-28 16:00:33 +00:00
Edwin Brady
c1199deed0
Merge pull request #242 from ziman/fix-seqempty
Fix SeqEmpty in Text.Lexer.Core.
2020-03-28 15:59:43 +00:00
Edwin Brady
8559bc4176 Add :? for REPL help
Needs a special case since ? isn't a name, but it's the only one we'll
need (I think!)
2020-03-28 14:42:21 +00:00
Edwin Brady
52273bec5d Some documentation edits
Update Getting Started with installation instructions
2020-03-28 14:21:12 +00:00
Edwin Brady
7c71d5dd46
Merge pull request #239 from deviant-forks/repl-help
Add basic help to REPL
2020-03-28 14:03:43 +00:00
Matus Tejiscak
d819bf5a9d Fix SeqEmpty in Text.Lexer.Core. 2020-03-28 15:02:08 +01:00
Marshall Bowers
57dc1b62f1 Move :compile to the command table 2020-03-28 00:18:34 -04:00
Marshall Bowers
6b386c482e Move :log to the command table 2020-03-27 23:56:30 -04:00
Marshall Bowers
b0204accd3 Move :set and :unset to the command table 2020-03-27 23:44:38 -04:00
Marshall Bowers
48a7949d4d Add help text for :search and :di 2020-03-27 23:43:04 -04:00
Marshall Bowers
a5fa2e00e6 Reorder commands to the way they were prior to changes 2020-03-27 23:29:54 -04:00
Marshall Bowers
476e776083 Account for the various ways to parse commands 2020-03-27 23:28:32 -04:00
Marshall Bowers
abdad354dc Format the help command 2020-03-27 22:27:36 -04:00
Edwin Brady
2938e86421 Ints in buffers are 32 bit
...for consistency with Idris 1 (probably to be revisited later). So,
when working via the scheme primitives, we need to read/write 32 bits.
2020-03-27 20:54:39 +00:00
Edwin Brady
ebafddcfc9 Look for scrutinee type in case
We can work out what it should be since each case is supposed to have
the same type, so we can look ahead to the alternatives. This way, we
don't have to rely on the scrutinee alone to calculate the type of the
case block. (Idris 1 does this too but I've only just encountered the
need for it in Idris 2 now!)
2020-03-27 14:27:33 +00:00
Marshall Bowers
0371d5b0d1 Move :exec to the command table 2020-03-26 22:35:27 -04:00
Marshall Bowers
9701a178b5 Use the same command table for both parsing and help 2020-03-26 22:17:15 -04:00
Edwin Brady
654c306ed5 Update idemode tests
Change in evaluation order changes the internal names - not that we
should be exposing these anyway, but that can be tidied up later...
2020-03-27 00:34:21 +00:00
Edwin Brady
bce7a5e747
Merge pull request #205 from abailly/syntax-highlight
first stab at syntax highlighting in Emacs
2020-03-27 00:22:19 +00:00
Edwin Brady
ed5b53d97f Rabbit hole
Sorry for the less than informative title :). Lots going on here. It
started as an attempt to fix unification to deal with laziness coercions
in trickier places, but unearthed a couple of tricky and interconnected
issues that are hard to unpick into a single patch. So, this fixes a few
things:

- default hints should only be resolved on the current elaboration (e.g.
nested function definitions, not the outer definition which might not
yet be complete)
- delayed elaborators should be allowed to have nested delayed
elaborators, which means disambiguation is a little bit better
- we should delay elaborating arguments where the type isn't known yet,
because later arguments may resolve the type, and we can use this to
help with disambiguation/laziness coercions
- other bits and pieces arising
2020-03-27 00:11:21 +00:00
Marshall Bowers
290db90025 Add ability to display the help 2020-03-26 00:30:25 -04:00