Commit Graph

916 Commits

Author SHA1 Message Date
Edwin Brady
59503712f3 Add --dumpcases option
Output goes in the same directory as the generated code (so
build/exec/<appname>_app for the Chez back end)
2020-04-02 16:11:10 +01:00
Edwin Brady
8029241458
Merge pull request #256 from gallais/faster-lexer
[ performance ] rewrite-free concatMap
2020-04-02 16:11:02 +01:00
Edwin Brady
f85e1f62b1
Merge pull request #255 from ziman/exec-cwd
Don't clobber CWD in `--exec`
2020-04-02 16:09:16 +01:00
Guillaume Allais
ad916b908f [ performance ] rewrite-free concatMap
Simply removing rewrites took me down from a user time of ~1m8s
to ~54s when running `make test`. The (small) code duplication
in `scan` is a bit annoying.

We could have a core unindexed data structure and then only export
pseudo-constructors with the right phantom arguments. Not sure it
is worth it yet though.

A more principled solution would of course be to make sure the backend
gets rid of the code corresponding to rewrites altogether!
2020-04-02 15:17:32 +01:00
Matus Tejiscak
6917f09a02 Fix tempfile names. 2020-04-01 21:57:36 +02:00
Matus Tejiscak
66169377b1 Don't clobber CWD in --exec. 2020-04-01 21:49:55 +02:00
Edwin Brady
2c41a39df2
Merge pull request #253 from gallais/nested-comments
[ fix ] properly nesting multiline comments
2020-04-01 14:50:08 +01:00
Edwin Brady
e45e562a95
Merge pull request #252 from gallais/updates-cleanup
[ cosmetic ] cleanup trailing whitespace + typos
2020-04-01 14:49:02 +01:00
Guillaume Allais
4cbb02b6b3 [ fix ] properly nesting multiline comments
We should be able to comment out any part of a program that parses
and still get a program that parses. This means we need to properly
ignore `{-` and `-}` when hidden behind a `--` comment or inside of
a string literal.
2020-04-01 12:52:01 +01:00
Guillaume Allais
2c7b2469a4 [ cosmetic ] cleanup trailing whitespace + typos 2020-04-01 10:19:27 +01:00
Edwin Brady
0cbc3b8396 Prioritise List :: at the REPL
This is a temporary hack (no, honestly...) until we get some syntax for
prioritising specific names like the 'with' disambiguation in Idris 1.
There are better ways to achieve this, but this will make the REPL
easier to play with for new users.
2020-04-01 00:08:11 +01:00
Edwin Brady
616495d6c7 Add Idris.Version to ipkg 2020-03-31 23:39:00 +01:00
Edwin Brady
07ed0352a2 Initialise a CHANGELOG 2020-03-31 22:43:58 +01:00
Edwin Brady
7f4659814c Set version number to 0.1.0 2020-03-31 22:41:15 +01:00
Edwin Brady
fb22e3de73 Fix racket codegen
Need a require to get the system function
2020-03-31 22:40:09 +01:00
Edwin Brady
e027e0c434 --build and --clean now looks at executable field
Executables now get built and deleted. Install doesn't do anything with
the executable, and --clean only deletes the executable itself (not any
support files or libraries that might also have been generated in the
exec directory)
2020-03-31 22:33:58 +01:00
Edwin Brady
4f9624a76c Update CONTRIBUTORS 2020-03-31 18:20:46 +01:00
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