mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-25 20:51:43 +03:00
04e05e3f86
As it was, it could break if the argument was repeated more than twice. When checking dot patterns, we need to check that no further holes are solved, and that the pattern variable doesn't unify with some other pattern variable, but if it had already made progress (either for a good or bad reason) we missed this. Fixes #536
22 lines
527 B
Idris
22 lines
527 B
Idris
infixl 0 ~~
|
|
prefix 1 |~
|
|
infix 1 ...
|
|
|
|
public export
|
|
(...) : (x : a) -> (y ~=~ x) -> (z : a ** y ~=~ z)
|
|
(...) x pf = (x ** pf)
|
|
|
|
public export
|
|
data FastDerivation : (x : a) -> (y : b) -> Type where
|
|
(|~) : (x : a) -> FastDerivation x x
|
|
(~~) : FastDerivation x y ->
|
|
(step : (z : c ** y ~=~ z)) -> FastDerivation x z
|
|
|
|
public export
|
|
Calc : {x : a} -> {y : b} -> FastDerivation x y -> x = y
|
|
Calc (|~ x) = Refl
|
|
Calc {y} ((~~) {z=y} {y=y} der (MkDPair y Refl)) = Calc der
|
|
|
|
bad : Z = S Z
|
|
bad = Calc $ |~ Z ~~ Z ...(Refl)
|