mirror of
https://github.com/idris-lang/Idris2.git
synced 2025-01-03 09:12:03 +03:00
A function from Not (x = y)
to decEq x y = No _
was added.
This commit is contained in:
parent
f390fba766
commit
0ac34538ec
@ -27,3 +27,10 @@ decEqSelfIsYes : DecEq a => {x : a} -> decEq x x = Yes Refl
|
||||
decEqSelfIsYes {x} with (decEq x x)
|
||||
decEqSelfIsYes {x} | Yes Refl = Refl
|
||||
decEqSelfIsYes {x} | No contra = absurd $ contra Refl
|
||||
|
||||
||| If you have a proof of inequality, you're sure that `decEq` would give a `No`.
|
||||
export
|
||||
decEqContraIsNo : DecEq a => {x, y : a} -> Not (x = y) -> (p ** decEq x y = No p)
|
||||
decEqContraIsNo uxy with (decEq x y)
|
||||
decEqContraIsNo uxy | Yes xy = absurd $ uxy xy
|
||||
decEqContraIsNo _ | No uxy = (uxy ** Refl)
|
||||
|
Loading…
Reference in New Issue
Block a user