Skip to content

Commit ecd3b06

Browse files
authored
[ refactor ] Change definition of Data.Nat.Base._≤′_ (#2523)
* refactor in line with #2504 / #2519 * tidy up `CHANGELOG` ahead of merge conflict resolution * refactor: redefine pattern synonym
1 parent 4b790d4 commit ecd3b06

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Non-backwards compatible changes
3030
them to name the operation `+`.
3131
* `distribˡ` and `distribʳ` are defined in the record.
3232

33-
* [issue #2504](https://github.com/agda/agda-stdlib/issues/2504) In `Data.Nat.Base` the definition of `_≤‴_` has been modified to make the witness to equality explicit in a new `≤‴-reflexive` constructor; a pattern synonym ≤‴-refl` has been added for backwards compatibility but NB. the change in parametrisation means that this pattern is *not* well-formed if the old implicit arguments `m`,`n` are supplied explicitly.
33+
* [issue #2504](https://github.com/agda/agda-stdlib/issues/2504) and [issue #2519](https://github.com/agda/agda-stdlib/issues/2510) In `Data.Nat.Base` the definitions of `_≤′_` and `_≤‴_` have been modified to make the witness to equality explicit in new constructors `≤′-reflexive` and `≤‴-reflexive`; pattern synonyms `≤′-refl` and `‴-refl` have been added for backwards compatibility but NB. the change in parametrisation means that these patterns are *not* necessarily well-formed if the old implicit arguments `m`,`n` are supplied explicitly.
3434

3535
Minor improvements
3636
------------------

src/Data/Nat/Base.agda

+4-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,10 @@ suc n ! = suc n * n !
338338
infix 4 _≤′_ _<′_ _≥′_ _>′_
339339

340340
data _≤′_ (m : ℕ) : Set where
341-
≤′-refl : m ≤′ m
342-
≤′-step : {n} (m≤′n : m ≤′ n) m ≤′ suc n
341+
≤′-reflexive : {n} m ≡ n m ≤′ n
342+
≤′-step : {n} m ≤′ n m ≤′ suc n
343+
344+
pattern ≤′-refl {m} = ≤′-reflexive {n = m} refl
343345

344346
_<′_ : Rel ℕ 0ℓ
345347
m <′ n = suc m ≤′ n

src/Data/Nat/Properties.agda

+2-2
Original file line numberDiff line numberDiff line change
@@ -2039,11 +2039,11 @@ z≤′n {zero} = ≤′-refl
20392039
z≤′n {suc n} = ≤′-step z≤′n
20402040

20412041
s≤′s : m ≤′ n suc m ≤′ suc n
2042-
s≤′s ≤′-refl = ≤′-refl
2042+
s≤′s (≤′-reflexive m≡n) = ≤′-reflexive (cong suc m≡n)
20432043
s≤′s (≤′-step m≤′n) = ≤′-step (s≤′s m≤′n)
20442044

20452045
≤′⇒≤ : _≤′_ ⇒ _≤_
2046-
≤′⇒≤ ≤′-refl = ≤-refl
2046+
≤′⇒≤ (≤′-reflexive m≡n) = ≤-reflexive m≡n
20472047
≤′⇒≤ (≤′-step m≤′n) = m≤n⇒m≤1+n (≤′⇒≤ m≤′n)
20482048

20492049
≤⇒≤′ : _≤_ ⇒ _≤′_

0 commit comments

Comments
 (0)