File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ private
2626 ∷-injective : ∀ {x y xs ys} →
2727 (List⁺ A ∋ x ∷ xs) ≡ y ∷ ys → x ≡ y × xs ≡ ys
2828 ∷-injective refl = (refl , refl)
29+
2930module _ ⦃ _ : DecEq A ⦄ where instance
3031 DecEq-List⁺ : DecEq (List⁺ A)
3132 DecEq-List⁺ ._≟_ (x ∷ xs) (y ∷ ys)
@@ -44,6 +45,15 @@ module _ ⦃ _ : DecEq A ⦄ where instance
4445 DecEq-Maybe ._≟_ = M.≡-dec _≟_
4546 where import Data.Maybe.Properties as M
4647
48+ open import Data.Refinement
49+
50+ -- Equality for a Refinement type is decide if the equality
51+ -- for the type to be refined is decidable.
52+ DecEq-Refinement : ∀ {p} {P : A → Set p} → DecEq (Refinement A P)
53+ DecEq-Refinement ._≟_ (x , px) (y , py) with x ≟ y
54+ ... | no neq = no (neq ∘ cong value)
55+ ... | yes refl = yes refl
56+
4757module _ ⦃ _ : DecEq A ⦄ ⦃ _ : DecEq B ⦄ where
4858
4959 -- Not exported as instance so that users can also choose `Class.DecEq.WithK.DecEq-Σ`
You can’t perform that action at this time.
0 commit comments