Skip to content

Commit aa62ce6

Browse files
committed
DecEq: polish Refinement instance
1 parent 90260db commit aa62ce6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Class/DecEq/Instances.agda

+4-7
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,11 @@ module _ ⦃ _ : DecEq A ⦄ where instance
4545
DecEq-Maybe ._≟_ = M.≡-dec _≟_
4646
where import Data.Maybe.Properties as M
4747

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)
48+
DecEq-Refinement : {P : A Set ℓ} DecEq (Refinement A P)
49+
DecEq-Refinement ._≟_ x y
50+
with x .value ≟ y .value
5551
... | yes refl = yes refl
52+
... | no ¬eq = no (¬eq ∘ cong value)
5653

5754
module _ ⦃ _ : DecEq A ⦄ ⦃ _ : DecEq B ⦄ where
5855

Class/Prelude.agda

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ open import Data.Vec public
4242
using (Vec; []; _∷_)
4343
open import Data.These public
4444
using (These; this; that; these)
45+
open import Data.Refinement public
46+
using (Refinement; _,_; value)
4547

4648
open import Relation.Nullary public
4749
using (¬_; Dec; yes; no; contradiction)

0 commit comments

Comments
 (0)