Commit Graph

1188 Commits

Author SHA1 Message Date
Edwin Brady
1c4b558b26
Merge pull request #271 from ohad/bugfix-269
Bugfix #269
2020-04-06 22:27:19 +01:00
Edwin Brady
3b07afc601
Merge pull request #268 from gallais/interactive-test
[ new ] interactive test runner
2020-04-06 22:12:15 +01:00
Edwin Brady
e383c2793d
Merge pull request #265 from then0rTh/patch-1
fix typo in docs/tutorial/typesfuns.rst
2020-04-06 22:02:40 +01:00
Edwin Brady
36897138db
Merge pull request #261 from gallais/resugar
Resugar `Nat` literals
2020-04-06 21:58:14 +01:00
Edwin Brady
8beeb6ee5a
Merge pull request #260 from ska80/tutorial/idris-prompt
Update Idris prompt in the tutorial
2020-04-06 21:56:27 +01:00
Edwin Brady
db409e29fe
Merge pull request #259 from gallais/cleanup-lexer
A little cleanup
2020-04-06 21:56:16 +01:00
Ohad Kammar
5589ed6c20 Merge branch 'bugfix-269' into fully-abstract-records 2020-04-06 17:36:56 +01:00
Ohad Kammar
f7dca2ba7d minor: Fix whitespace 2020-04-06 17:36:09 +01:00
Ohad Kammar
53819ab278 Merge branch 'bugfix-269' into fully-abstract-records 2020-04-06 17:15:02 +01:00
Ohad Kammar
b44619e7a8 Replace redundant <- notation with let
Following @gallais's [review](https://github.com/edwinb/Idris2/pull/271#pullrequestreview-388352322)
2020-04-06 16:43:17 +01:00
Ohad Kammar
fbf82eaf0b Bugfix #269
Make desugaring/elaboration of interfaces, interface implementations,
records, and parameter blocks take into account the pragma
`%unbound_implicits off`.

Main changes:

(a) Execute the pragma also during desugaring
(b) Check whether `isUnboundImplicits` is on at each desugaring step

Alternatives I didn't take:

(1) Changing `findBindableNames` to effectfully check the flag.

  Rationale:
  Apart from turning a pure function into an effectful one, this
  would mean repeatedly calling `findBindableNames`, only to do
  nothing once the flag is read.

(2) Adding another function that takes multiple places (list of terms)
  that might contain bindable names, and before dispatching
  `findBindableNames` on each term, checking the flag.

  Rationale: I didn't want to add another abstraction. (weak
  rationale)

@edwinb @gallais : if you prefer (2), I can do that.
2020-04-06 15:56:48 +01:00
Ohad Kammar
a61911e1ed Make parsing of record declaration parameters separate from interfaces
This is to support a richer type signature (implicit arguments,
multiplicity annotations)
2020-04-06 13:55:48 +01:00
Guillaume Allais
6e2ccb085e [ more ] show the diff in case of mismatch 2020-04-06 11:29:18 +01:00
Guillaume Allais
5ae54488d7 [ new ] interactive test runner 2020-04-06 11:06:19 +01:00
then0rTh
e6fe418a6b
fix typo in docs/tutorial/typesfuns.rst
duplicated word
2020-04-04 22:58:34 +02:00
Guillaume Allais
8cb17de3f9 [ fix ] resugar to drop name prefixes
My first attempt at refolding natural constants led to all names
being printed with their namespace prefixes. This fixes that,
most notably by introducing the massive `mapPTermM` function in
`Idris.Syntax`.
2020-04-03 20:00:59 +01:00
Kamil Shakirov
55b3f880d3 Update Idris prompt in the tutorial 2020-04-03 16:44:12 +06:00
Guillaume Allais
e1aea9fae7 [ new ] resugar Prelude's natural numbers 2020-04-03 00:00:16 +01:00
Guillaume Allais
d92a65c43e [ admin ] add empty default target distinct from clean
Tired of having to rebuild everything because I typed `make` in
the wrong directory.
2020-04-02 22:21:40 +01:00
Guillaume Allais
c3f3fdb224 [ cleanup ] scan
Remove one assert_total by re-using strIndex.
2020-04-02 17:31:15 +01:00
Guillaume Allais
c5903c45e1 [ cosmetic ] various whitespace issues 2020-04-02 17:31:15 +01:00
Guillaume Allais
d433eafa97 [ doc ] various doc comments 2020-04-02 17:31:15 +01:00
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