Commit Graph

3 Commits

Author SHA1 Message Date
David Raymond Christiansen
6c4553c31f Make --quiet imply non-verbosity
This causes Idris to not emit messages about "Type checking ...." while
in quiet mode, which improves the portability of tests to Windows (due
to the slash facing the other way there). It also makes tests a bit more
robust with regards to their source files changing names.
2015-04-01 17:48:17 +02:00
Edwin Brady
43127b17a7 Move Fin, Vect and So from prelude to base
They can be imported from the modules Data.Fin, Data.Vect, and Data.So
respectively.

The general thinking here is that not every program is going to need
these, and they are often used especially by newcomers in place of
something more appropriate. Also, all of them are useful for teaching,
which means it is instructive for tutorials to introduce them and have
people implement them themselves.
2014-12-31 20:18:02 +00:00
Edwin Brady
e07c13d42d Add :refine (:ref) command for refining a hole
Like :ps, but instead of a recursive search, it simply applies the
function given and fills in other arguments *by unification only*.

(In particular, this means it will fail if any implicit arguments need
other arguments, rather than the return type, in order to be solved by
unification).

So, this will work:

append : (n, m : Nat) -> Vect n a -> Vect m a -> Vect (n + m) a
append Z m [] ys = ys
append (S k) m (x :: xs) ys = x :: ?append_rhs1

*testref> :ref 6 append_rhs1 append
append k m ?append_rhs2 ?append_rhs3

But this will not:

vZipWith : (a -> b -> c) -> Vect n a -> Vect n b -> Vect n c
vZipWith f [] [] = []
vZipWith f (x :: xs) (y :: ys) = f x y :: ?vZipWith_rhs1

*Vect> :ref 18 vZipWith_rhs1 vZipWith
?vZipWith_rhs1

...because unification alone is not enough to work out the implicit
arguments a and b (even if there is only one thing that will work, it
needs a deeper proof search to find it).
2014-04-17 15:41:06 +01:00