Commit Graph

6905 Commits

Author SHA1 Message Date
Jeremy W. Sherman
4274456d4d Add test that IPKG executable accepts namespaced identifier
This tests that the current behavior of Idris when parsing the target
executable name is preserved.
2015-10-12 23:32:44 -04:00
Jeremy W. Sherman
67ff67e4d8 PParser.hs: filename: Explain failed parse with |fail|
This still provides misleading output from the parser about what it
was expecting, but does explain what the actual problem was:

    *Pkg.PParser> execout <$> runparser pPkg defaultPkg "foo.ipkg"
                  "package bar\n\nexecutable = \"invalid/filename\""
    Failure foo.ipkg:3:32: error: a filename
        must be non-empty and have no
        directory
        component, expected: space
    executable = "invalid/filename"<EOF>
                                   ^
2015-10-12 23:16:00 -04:00
Jeremy W. Sherman
3ccdc4b7c7 PParser.hs: filename: Verify it is a non-empty filename
Using |guard| after the parser has done its work leads to unfortunate
error messages on parse failure, though:

    *Pkg.PParser> execout <$> runparser pPkg defaultPkg "foo.ipkg"
                  "package bar\n\nexecutable = \"invalid/filename\""
    Failure foo.ipkg:3:32: error: expected: space
    executable = "invalid/filename"<EOF>
                                   ^
2015-10-12 23:11:36 -04:00
Jeremy W. Sherman
44b87ecd19 PParser.hs: filename: Restore backwards compatibility
We've used iName to parse the executable filename till now.
This change ensures we don't break any extant IPKG files.
2015-10-12 22:44:29 -04:00
Jeremy W. Sherman
5eeaf9e1c7 PParser.hs: filename: Remove use of |try|
There's no need to rewind consumed input here should parsing fail,
so there's no need for |try|.

Thanks @david-christiansen for pointing this out.
2015-10-12 22:15:45 -04:00
Jeremy W. Sherman
d75e4c6d29 Remove advice to import Language.Reflection.Elab
This no longer applies as of HEAD, as pointed out by @david-christiansen,
because the Prelude now includes this namespace.

Replace the advice with a tip to :browse the Tactics module to see the list of
tactics prior to entering the elab shell.
2015-10-12 18:27:23 -04:00
Jeremy W. Sherman
c6c4bf4688 Drop claim that general-purpose commands are general REPL commands
:e at least is not, as pointed out by @david-christiansen.
2015-10-12 18:21:25 -04:00
Jeremy W. Sherman
d17f246735 Remove duplicated phrase 2015-10-12 18:21:03 -04:00
Jeremy W. Sherman
f30db6b227 Fix typo: reply -> REPL
Thanks to @david-christiansen for catching this.
2015-10-12 18:19:36 -04:00
David Raymond Christiansen
1e687f3b5d Rename record fields in reflection
Now, there is more overloading, but we get simpler, more memorable names
as a result.
2015-10-12 20:05:09 +02:00
Jeremy W. Sherman
ffa41abb50 CONTRIBUTING.md: Fix typo "Factroy" -> "Factory" 2015-10-12 00:25:54 -04:00
Jeremy W. Sherman
b6a8a95b7c PParser.hs: Parse executable clause argument as filename
Previously, it was parsed as an iName, AKA a possibly-namespaced identifier.

This meant you could have dots in your executable's name, but no hyphens!

See: #2721: Allow dashes in package names
(https://github.com/idris-lang/Idris-dev/issues/2721)
2015-10-12 00:22:29 -04:00
Jeremy W. Sherman
c772bf53c4 PParser.hs: Add |filename| parser
As it stands, it reads in either a (possibly namespaced) identifier,
which was the old behavior, or a double-quoted string, which is the new
behavior.

This could be improved by actually testing that it's returning a filename,
but I'm clumsy with the parser abstraction, and it wasn't clear to me
from the Trifecta docs I looked through how to pass it through
System.FilePath.takeFileName and then enforce that it was a non-empty string.
2015-10-11 23:51:49 -04:00
Jeremy W. Sherman
6a7b071923 Update the list of elaboration shell commands
Cover all and only the commands understood by |parseElabShellStep|,
defined in ParseShell.hs.

The previous list omitted some commands and included others that no longer
were available.

Also:

- Groups the commands (general, view proof state, alter proof state)
- Adds an intro summarizing how interactive proving works at a high level.
- Advises the reader to pull in the `Language.Reflection.Elab` module
  _before_ entering the elaboration shell.
2015-10-10 21:05:27 -04:00
Jeremy W. Sherman
be1183892c Removes :q alias for :abandon
As of Idris v0.9.19, :q is no longer accepted by the elab shell.
2015-10-10 20:34:10 -04:00
Jeremy W. Sherman
c18bf77285 Rephrases section "Interactively building elaboration scripts"
- Bullets converted to sentences rather than quasi-definition-list format.
- Aliases merged into a single bullet.
- Intro rewritten to introduce `:m` command before the `:elab` command.
- `:elab` introduced with its argument, as shown in the Idris REPL help.
2015-10-10 20:32:06 -04:00
David Raymond Christiansen
83ca4aebec Friendlier error on proof search failure
Now, proof search doesn't throw an INTERNAL ERROR when called on a goal
that isn't a datatype. Instead, it provides the following message:

    Prover error: Attempted to find an element of type Nat -> Bool using
    proof search, but proof search only works on datatypes with
    constructors.

When the goal is a function type, which seems to be a likely reason why
it would fail, it adds the sentence:

    In particular, function types are not supported.

Additionally, a variant of the Msg constructor for errors, called
FancyMsg, was introduced. This allows the use of the ErrorReportPart
type to define custom messages.

Fixes #2713.
2015-10-11 01:00:26 +02:00
David Raymond Christiansen
4f68012673 Convert some datatypes to records in reflection 2015-10-11 00:58:32 +02:00
David Raymond Christiansen
6ca7c4f24d Add reflexivity tactic to Pruviloj
This is useful for _only_ solving goals that are equalities, which is
convenient when developing and testing certain kinds of proof automation
that should always produce equalities.
2015-10-11 00:58:32 +02:00
Jeremy W. Sherman
002e9b9f89 elaborator-reflection.rst: Fix rendering of bulleted list
reST requires a blank line before a bulleted list, otherwise it just renders
the whole mess as a paragraph with a lot of dashes in it.
2015-10-10 16:54:19 -04:00
Edwin Brady
2cda43e36c Update docs test 2015-10-09 15:51:00 +01:00
Edwin Brady
3268c1bf5a Change documentation of map
Accurate as it is, it's not necessarily useful to explain concepts using
category theory terminology. Ideally, the documentation should give some
intuition for those not yet familiar with the concepts.
2015-10-09 14:59:22 +01:00
David Christiansen
c7efd0af37 Merge pull request #2714 from david-christiansen/no-more-ugly-script
Remove NErased
2015-10-09 14:33:21 +02:00
Craig McLaughlin
7806ff594f Fixed comment of Effect type; ordering incorrect and vague. 2015-10-09 11:43:52 +01:00
David Raymond Christiansen
0f89577db7 Remove NErased
The name constructor NErased was produced precisely two places in the
source, each as a kind of failure representation rather than as a name
referring to something that had been erased, like the docs stated. The
vestigial constructor has been removed.
2015-10-09 12:07:54 +02:00
David Christiansen
be03634759 Merge pull request #2712 from david-christiansen/no-more-ugly-script
Show source location of case block names
2015-10-09 11:52:51 +02:00
David Raymond Christiansen
d5b66a9188 Show source location of case block names
Names for case block functions (such as "case block in f") now show the
source location from which they originated. This will make it easier to
diagnose problems like totality warnings coming from case blocks,
staging restriction errors from %runElab, and similar.
2015-10-09 10:31:17 +02:00
David Christiansen
32269f8e43 Merge pull request #2711 from david-christiansen/no-more-ugly-script
Improvements to Elab user-friendliness
2015-10-09 08:31:48 +02:00
David Raymond Christiansen
32ce95ff80 Better error on staging problem for Elab scripts
Now, Elab scripts are pre-analyzed to see if they contain unelaborated
case splits. If so, they are not executed, and a suggestion is made as
to how to fix it.
2015-10-08 22:50:21 +02:00
David Raymond Christiansen
d244c04e60 Improve tactic documentation 2015-10-08 21:31:41 +02:00
David Raymond Christiansen
83aa146947 Stop let-binding Elab scripts around their holes
This prevents them from showing up in intermediate elaboration states
and making things difficult to read.
2015-10-08 21:11:33 +02:00
David Christiansen
76f9286a9e Merge pull request #2709 from david-christiansen/issue/2705
Error message instead of crash when searching on a guess
2015-10-08 21:04:02 +02:00
David Raymond Christiansen
3b9206bc6b Error message instead of crash when searching on a guess
Fixes #2705.
2015-10-08 17:44:13 +02:00
Jan de Muijnck-Hughes
4e8db4ad3a Merge pull request #2707 from jfdm/rtd-menu-cleanup
Idris Doc menu cleanup
2015-10-08 14:04:58 +01:00
Jan de Muijnck-Hughes
7b24211ad4 Bumped version number for docs. 2015-10-08 12:06:21 +01:00
Jan de Muijnck-Hughes
262369c489 Fixed reST error in docs. 2015-10-08 12:02:59 +01:00
Jan de Muijnck-Hughes
c1b329c708 Cleaned up the menu for the docs.
The side bar now points directly to the index pages for each sub page.
2015-10-08 12:01:33 +01:00
David Christiansen
13045109d0 Merge pull request #2702 from david-christiansen/reflection-simplification
Reflection simplification
2015-10-07 18:18:43 +02:00
David Raymond Christiansen
cc9cac4fdb Improve the documentation of Language.Reflection
Now, there are docstrings corresponding to those in TT.hs.
2015-10-07 12:06:12 +02:00
David Raymond Christiansen
b774d124e3 Remove NLet binder from reflection API
This will never occur during elaboration - it's a part of the evaluator.
2015-10-07 11:50:02 +02:00
David Raymond Christiansen
01e51f1576 CHANGELOG update for simplified reflection 2015-10-07 11:00:36 +02:00
David Raymond Christiansen
4b06aa4c6c CHANGELOG update for simplified reflection 2015-10-07 10:59:02 +02:00
David Christiansen
539394b0e8 Merge pull request #2699 from david-christiansen/reflection-simplification
Simplify reflection and Raw
2015-10-06 18:29:12 +02:00
David Raymond Christiansen
105c230217 Simplify reflection and Raw
Some constructors of TT will never occur during elaboration, but are
instead a part of the optimization process. Thus, they have been removed
from reflection, to simplify the interface.

Likewise, I discovered that RForce is no longer produced anywhere in
Idris, so it was also deleted from both the reflection API and the
internals.
2015-10-06 17:03:38 +02:00
David Christiansen
75e45f9e7c Merge pull request #2680 from eklavya/patch-1
Safe String to Int function. #2639
2015-10-06 10:41:35 +02:00
Zack Grannan
2c91acc319 Changed to not affect normal expression parsing 2015-10-06 05:12:15 +00:00
Zack Grannan
a8f7652f2a Update tests 2015-10-05 21:41:47 -07:00
Zack Grannan
17d75fb64f Add test to idris 2015-10-05 21:41:47 -07:00
Zack Grannan
5f89889be4 Update CONTRIBUTORS 2015-10-05 21:41:47 -07:00
Zack Grannan
14cf196d97 Added tests 2015-10-05 21:41:47 -07:00