Closed rgrover closed 4 years ago
Idris is right to complain there. You can't assume that ==
is reflexive; the following is a valid program.
data MyType = A | B
Eq MyType where
(==) _ _ = False
I recommend using DecEq
whenever this matters.
(DecEq
does not suffer from Boolean Blindness.)
Thank you so much!
In the above, contradiction has the type
False = True
. It should be possible to replace it with impossible
Note that contradiction
is a goal. As such it is your responsibility to
provide a proof of the right type. By contrast, impossible
's job is to dismiss
an hypothesis with an impossible type. That is why it cannot be used here.
Steps to Reproduce
I'm trying to prove that for any
x
that satisfiesEq
,x == x
should returnTrue
. Maybe my assumption is incorrect, and this property is unprovable in general. Nevertheless, my proof reaches a point where I get a hole with the typeFalse = True
, which is obviously uninhabited, but I fail to make progress.Expected Behavior
In the above,
contradiction
has the typeFalse = True
. It should be possible to replace it withimpossible
. The following should compile:Observed Behavior
Idris2 complains:
with block in equalityReflexive a _ x False is not a valid impossible case
Idris1 complains: