Skip to content

Commit 17f0393

Browse files
committed
[fix] issue agda#1726
1 parent f7692c4 commit 17f0393

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,11 @@ Deprecated names
866866
raise ↦ _↑ʳ_
867867
```
868868

869+
Issue #1726: the relation `_≺_` and its single constructor `_≻toℕ_`
870+
have been deprecated in favour of their extensional equivalent `_<_`
871+
but omitting the inversion principle which pattern matching on `_≻toℕ_`
872+
would achieve; this instead is proxied by the property `Data.Fin.Properties.toℕ<`.
873+
869874
* In `Data.Fin.Properties`:
870875
```
871876
toℕ-raise ↦ toℕ-↑ʳ
@@ -876,6 +881,9 @@ Deprecated names
876881
eq? ↦ inj⇒≟
877882
```
878883

884+
Likewise under issue #1726: the properties `≺⇒<′` and `<′⇒≺` have been deprecated
885+
in favour of their proxy counterparts `<⇒<′` and `<′⇒<`.
886+
879887
* In `Data.Fin.Permutation.Components`:
880888
```
881889
reverse ↦ Data.Fin.Base.opposite

src/Data/Fin/Base.agda

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -332,32 +332,12 @@ NB argument order has been flipped:
332332
the left-hand argument is the Fin m
333333
the right-hand is the Nat index increment."
334334
#-}
335-
336335
------------------------------------------------------------------------
337336
-- _≺_
338337

339338
data _≺_ : Set where
340339
_≻toℕ_ : n (i : Fin n) toℕ i ≺ n
341340

342-
------------------------------------------------------------------------
343-
-- properties of _≺_
344-
-- introduce new proofs, actually simplified compared to original
345-
-- so that Data.Fin.Properties doesn't mention the constructor
346-
347-
private
348-
349-
z≺s : {n} zero ≺ suc n
350-
z≺s = _ ≻toℕ zero
351-
352-
s≺s : {m n} m ≺ n suc m ≺ suc n
353-
s≺s (n ≻toℕ i) = (suc n) ≻toℕ (suc i)
354-
355-
-- new lemma, nowhere else used except to define deprecated property later
356-
357-
<⇒≺ : ℕ._<_ ⇒ _≺_
358-
<⇒≺ {zero} z<s = z≺s
359-
<⇒≺ {suc m} (s<s lt) = s≺s (<⇒≺ lt)
360-
361341
-- now do the deprecation!
362342
{-# WARNING_ON_USAGE _≺_
363343
"Warning: _≺_ was deprecated in v2.0.

src/Data/Fin/Properties.agda

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
------------------------------------------------------------------------
77

88
{-# OPTIONS --without-K --safe #-}
9+
{-# OPTIONS --warn=noUserWarning #-} -- for issue #1726
910

1011
module Data.Fin.Properties where
1112

@@ -1123,8 +1124,21 @@ Please use inj⇒≟ instead."
11231124
#-}
11241125
------------------------------------------------------------------------
11251126
-- deprecated properties of deprecated _≺_
1127+
-- introduce new proofs, actually simplified compared to original
1128+
-- so that Data.Fin.Properties doesn't mention the constructor
11261129

11271130
private
1131+
1132+
z≺s : {n} zero ≺ suc n
1133+
z≺s = _ ≻toℕ zero
1134+
1135+
s≺s : {m n} m ≺ n suc m ≺ suc n
1136+
s≺s (n ≻toℕ i) = (suc n) ≻toℕ (suc i)
1137+
1138+
<⇒≺ : ℕ._<_ ⇒ _≺_
1139+
<⇒≺ {zero} z<s = z≺s
1140+
<⇒≺ {suc m} (s<s lt) = s≺s (<⇒≺ lt)
1141+
11281142
≺⇒< : _≺_ ⇒ ℕ._<_
11291143
≺⇒< (n ≻toℕ i) = toℕ<n i
11301144

0 commit comments

Comments
 (0)