At the final step, if any elaboration adds new class constraints, reject
it in favour of any which do work.
This is particularly helpful in the case that there are holes which
would otherwise help determine which name is intended.
To aid in the managment of the test suit, the perl script now records
the duration of each test for compilation and execution. The resulting
time is then displayed to stdout in the form:
Duration of <test name> was <time>
When running tests locally, test output can be grep'd and graphs
plotted. A good improvement will be the automatic storing of the
results in a dat file.
This commit adds some documentation to the test script file, and more
importantly makes the script stack aware.
When running a test, the script already checks to see how idris is
being built if a cabal sandbox is not being used an additional check
for stack is now made. If neither of the tools were used to build
idris then it is assumed that the default set up is used.
I changed everything but the reflection and builtin stuff. I don't know
enough to mess with that. So there are a bunch of warnings for
Language.Reflection etc.
No need to do this when collecting deferred names, just do it for
display purposes. It's safer anyway, due to potential name clashes in
the normalisation. Fixes#2806
Sometimes elaboration of applications failed unnecessarily because we
assumed they'd have a simple type, and there'd be a strange error
reported if they didn't. Now use proper dependent application, and drop
back to the original simple version if the type of the function can't be
inferred.
Now look at the type of the patterns to infer what the argument type of
the new function should be. This helps if, for example, the scrutinee
function has some type which needs to be resolved to a specific type
class instance, and we can't do this from the scrutinee alone.
At the cost of having to check the result, file IO operations no longer
silently fail, so you won't get a segfault on trying to read a
non-existent file any more.
Pattern matching alternative notation makes this not too painful (see
Prelude.File.readFile for example)
Also, versions which throw exceptions instead could be implemented in
IOExcept, if exceptions are preferred.
Parser parses clauses independently so there is no parsing error
in code like this:
foo : Int -> Bool
foo 1 | 2 | 3 = True
foo _ = False
Elaborator can check if it sees with patterns but no enclosing with block,
so we report error in situations like this.