Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The function
MultHomomorphism
currently relies on a bug in Idris (idris-lang/Idris2#2250) for coverage. In that issue a(,)
or()
on the LHS of an impossible clause is treated as a pattern var (wildcard) during coverage checking. If we explicitly putMkPair
inMultHomomorphism
, the coverage check fails. The PR idris-lang/Idris2#3396 fixes idris-lang/Idris2#2250 by resolving the ambiguity asMkPair
instead of inserting a pattern variable and causes frex to fail to build. So we should update frex before that PR is merged.The Pair/MkPair ambiguity in the current frex code is short-circuiting coverage checking. This coverage check failure can be reproduced with the current Idris by writing
MkPair
for the pairs in the two impossible clauses ofMultHomomorphism
to get:The
MultHomomorphism
function is indeed covering - Idris accepts it as such when there are holes on the RHS instead ofimpossible
. The issue goes away if theMkAnd
match is pushed down into awith
clause, so that's what I do in this patch. There probably is a bug in coverage checking with respect to impossible clauses here, but I haven't tracked it down and the workaround seems sufficient.