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>
^
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>
^
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.
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)
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.
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.
- 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.
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.
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.
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.
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.
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.
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.
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.