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