Open jfdm opened 3 years ago
Maybe Idris forgets to abstract over n
when elaborating the 'with' expression ?
Or as another possibility: it abstracts over it but in the generated function representing the 'with' n
is not properly destructed by patterns on LHS (basically n
being a 'match-any' pattern variable in each clause) ?
My understanding is that the generated with function has the shape f {n} [] []
but now that both xs
and ys
have been pattern-matched on n
unifies with 0
and Idris would really like the user to write 0
instead.
The problem of course is that the user in this case is the idris elaborator for with functions and you get told
off for something that's not your mistake.
This is handled in Agda by letting users (both top level ones and elaborators) write whatever they want and
internally turning these type of n
in f {n} [] []
into n@0
.
Steps to Reproduce
Take the following Idris program that describes a view (
Compare
) over two vectors, the corresponding covering function (compare
), and a function (eq
) that uses the covering function.Expected Behavior
Should I be correct in expecting this program to type-check successfully.
Observed Behavior
Idris2 complains with:
I suspect what is happening that the internals are complaining about implicit parameters
n
andm
. When they are brought into scope as implicit parameters on the LHS everything typechecks.