Skip to content

Commit 7847620

Browse files
authored
[ refactor ] fix #2865 for v2.4 (#2954)
* [ refactor ] fix #2865 * refactor: another round of renaming * fix: revert changes to `List.Relation.Unary.Any` * add: comment documenting downstream intentions to make changes * add: additional content to the deprecation warning
1 parent bc975b3 commit 7847620

3 files changed

Lines changed: 37 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ Deprecated names
104104
witness ↦ satisfiable
105105
```
106106

107+
* In `Data.List.Relation.Unary.Any`:
108+
```agda
109+
satisfiable ↦ satisfiable⁺
110+
```
111+
107112
* In `Data.Rational.Properties`:
108113
```agda
109114
nonPos*nonPos⇒nonPos ↦ nonPos*nonPos⇒nonNeg
@@ -321,7 +326,7 @@ Additions to existing modules
321326

322327
* In `Data.List.NonEmpty.Relation.Unary.All`:
323328
```
324-
map : P ⊆ Q → All P xs → All Q xs
329+
map : P ⊆ Q → All P All Q
325330
```
326331

327332
* In `Data.List.Properties`:
@@ -331,6 +336,11 @@ Additions to existing modules
331336
filter-swap : filter P? ∘ filter Q? ≗ filter Q? ∘ filter P?
332337
```
333338

339+
* In `Data.List.Relation.Unary.Any`:
340+
```agda
341+
satisfiable⁻ : Satisfiable (Any P) → Satisfiable P
342+
```
343+
334344
* In `Data.Nat.Divisibility`:
335345
```agda
336346
m∣n⇒m^o∣n^o : ∀ o → m ∣ n → m ^ o ∣ n ^ o

src/Data/List/NonEmpty/Relation/Unary/Any.agda

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ map g (there pxs) = there (List.map g pxs)
4242
------------------------------------------------------------------------
4343
-- Predicates
4444

45-
satisfied : Any P xs Satisfiable P
46-
satisfied (here px) = _ , px
47-
satisfied (there pxs) = List.satisfied pxs
45+
satisfiable : Any P xs Satisfiable P
46+
satisfiable (here px) = _ , px
47+
satisfiable (there pxs) = List.satisfied pxs

src/Data/List/Relation/Unary/Any.agda

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ infixl 4 _─_
6969
_─_ : {P : Pred A p} xs Any P xs List A
7070
xs ─ x∈xs = removeAt xs (index x∈xs)
7171

72-
-- If any element satisfies P, then P is satisfied.
72+
-- If any element satisfies P, then P is satisfiable.
73+
74+
-- v2.4 `satisfied` is being retained for compatibility reasons,
75+
-- while `satisfiable` below is renamed to `satisfiable⁺`
76+
-- v3.0 `satisfied` will be renamed to `satisfiable`
7377

7478
satisfied : Any P xs Satisfiable P
7579
satisfied (here px) = _ , px
@@ -90,12 +94,16 @@ any? : Decidable P → Decidable (Any P)
9094
any? P? [] = no λ()
9195
any? P? (x ∷ xs) = Dec.map′ fromSum toSum (P? x ⊎? any? P? xs)
9296

93-
satisfiable : Satisfiable P Satisfiable (Any P)
94-
satisfiable (x , Px) = [ x ] , here Px
97+
satisfiable⁺ : Satisfiable P Satisfiable (Any P)
98+
satisfiable⁺ (x , Px) = [ x ] , here Px
99+
100+
satisfiable⁻ : Satisfiable (Any P) Satisfiable P
101+
satisfiable⁻ (x ∷ _ , here px) = x , px
102+
satisfiable⁻ (_ ∷ xs , there pxs) = satisfiable⁻ (xs , pxs)
95103

96104

97105
------------------------------------------------------------------------
98-
-- DEPRECATED
106+
-- DEPRECATED NAMES
99107
------------------------------------------------------------------------
100108
-- Please use the new names as continuing support for the old names is
101109
-- not guaranteed.
@@ -107,3 +115,14 @@ any = any?
107115
"Warning: any was deprecated in v1.4.
108116
Please use any? instead."
109117
#-}
118+
119+
-- Version 2.4
120+
121+
satisfiable = satisfiable⁺
122+
{-# WARNING_ON_USAGE satisfiable
123+
"Warning: satisfiable was deprecated in v2.4.
124+
Please use satisfiable⁺ instead. Moreover,
125+
the name satisfied will be renamed in v3.0
126+
to satisfiable, so users should refactor
127+
as soon as they can."
128+
#-}

0 commit comments

Comments
 (0)