File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ Non-backwards compatible changes
49
49
* Moved ` Data.Vec.Equality ` to ` Data.Vec.Relation.Equality ` (see "Deprecated
50
50
features" section for explanation)
51
51
52
+ * Changed Data.Nat.Divisibility's ` _|_ ` from data to record. As a consequence,
53
+ the two parameters are not implicit arguments of the constructor anymore (but
54
+ such values can be destructed using a let-binding rather than a with-clause).
55
+
52
56
Deprecated features
53
57
-------------------
54
58
Original file line number Diff line number Diff line change @@ -30,8 +30,10 @@ open import Function
30
30
31
31
infix 4 _∣_ _∤_
32
32
33
- data _∣_ : ℕ → ℕ → Set where
34
- divides : {m n : ℕ} (q : ℕ) (eq : n ≡ q * m) → m ∣ n
33
+ record _∣_ (m n : ℕ) : Set where
34
+ constructor divides
35
+ field quotient : ℕ
36
+ equality : n ≡ quotient * m
35
37
36
38
_∤_ : Rel ℕ _
37
39
m ∤ n = ¬ (m ∣ n)
@@ -61,11 +63,10 @@ quotient (divides q _) = q
61
63
divides (q * p) (sym (*-assoc q p _))
62
64
63
65
∣-antisym : Antisymmetric _≡_ _∣_
64
- ∣-antisym (divides {n = zero} _ _) (divides q refl) = *-comm q 0
65
- ∣-antisym (divides p eq) (divides {n = zero} _ _) =
66
- trans (*-comm 0 p) (sym eq)
67
- ∣-antisym (divides {n = suc _} p eq₁) (divides {n = suc _} q eq₂) =
68
- ≤-antisym (∣⇒≤ (divides p eq₁)) (∣⇒≤ (divides q eq₂))
66
+ ∣-antisym {m} {0 } _ (divides q eq) = trans eq (*-comm q 0 )
67
+ ∣-antisym {0 } {n} (divides p eq) _ = sym (trans eq (*-comm p 0 ))
68
+ ∣-antisym {suc m} {suc n} (divides p eq₁) (divides q eq₂) =
69
+ ≤-antisym (∣⇒≤ (divides p eq₁)) (∣⇒≤ (divides q eq₂))
69
70
70
71
∣-isPreorder : IsPreorder _≡_ _∣_
71
72
∣-isPreorder = record
You can’t perform that action at this time.
0 commit comments