Skip to content

Commit 2d6e7d5

Browse files
Deprecate _∷ʳ'_ (both versions) and decidable' functions in favour of version ending in prime. (#1202)
1 parent 07f1860 commit 2d6e7d5

File tree

4 files changed

+60
-8
lines changed

4 files changed

+60
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ Deprecated names
3737
* The proofs `replace-equality` from `Algebra.Properties.(Lattice/DistributiveLattice/BooleanAlgebra)`
3838
have been deprecated in favour of the proofs in the new `Algebra.Construct.Subst.Equality` module.
3939

40+
* In order to be consistent in usage of \prime character and apostrophe in identifiers, the following three names were deprecated in favor of their replacement that ends with a \prime character.
41+
42+
* `Data.List.Base.InitLast._∷ʳ'_``Data.List.Base.InitLast._∷ʳ′_`
43+
* `Data.List.NonEmpty.SnocView._∷ʳ'_``Data.List.NonEmpty.SnocView._∷ʳ′_`
44+
* `Relation.Binary.Construct.StrictToNonStrict.decidable'``Relation.Binary.Construct.StrictToNonStrict.decidable′`
45+
46+
4047
Other major additions
4148
---------------------
4249

src/Data/List/Base.agda

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,19 @@ xs ∷ʳ? x = maybe′ (xs ∷ʳ_) xs x
364364

365365
-- Backwards initialisation
366366

367-
infixl 5 _∷ʳ'_
367+
infixl 5 _∷ʳ_
368368

369369
data InitLast {A : Set a} : List A Set a where
370370
[] : InitLast []
371-
_∷ʳ'_ : (xs : List A) (x : A) InitLast (xs ∷ʳ x)
371+
_∷ʳ′_ : (xs : List A) (x : A) InitLast (xs ∷ʳ x)
372+
373+
372374

373375
initLast : (xs : List A) InitLast xs
374376
initLast [] = []
375377
initLast (x ∷ xs) with initLast xs
376-
... | [] = [] ∷ʳ' x
377-
... | ys ∷ʳ' y = (x ∷ ys) ∷ʳ' y
378+
... | [] = [] ∷ʳ x
379+
... | ys ∷ʳ y = (x ∷ ys) ∷ʳ y
378380

379381
------------------------------------------------------------------------
380382
-- Splitting a list
@@ -440,3 +442,13 @@ boolSpan p (x ∷ xs) with p x
440442

441443
boolBreak : (A Bool) List A (List A × List A)
442444
boolBreak p = boolSpan (not ∘ p)
445+
446+
-- Version 1.4
447+
448+
infixl 5 _∷ʳ'_
449+
_∷ʳ'_ : (xs : List A) (x : A) InitLast (xs ∷ʳ x)
450+
_∷ʳ'_ = InitLast._∷ʳ′_
451+
{-# WARNING_ON_USAGE _∷ʳ'_
452+
"Warning: _∷ʳ'_ (ending in an apostrophe) was deprecated in v1.4.
453+
Please use _∷ʳ′_ (ending in a prime) instead."
454+
#-}

src/Data/List/NonEmpty.agda

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ data SnocView {A : Set a} : List⁺ A → Set a where
193193
snocView : (xs : List⁺ A) SnocView xs
194194
snocView (x ∷ xs) with List.initLast xs
195195
snocView (x ∷ .[]) | [] = [] ∷ʳ′ x
196-
snocView (x ∷ .(xs List.∷ʳ y)) | xs List.∷ʳ' y = (x ∷ xs) ∷ʳ′ y
196+
snocView (x ∷ .(xs List.∷ʳ y)) | xs List.∷ʳ y = (x ∷ xs) ∷ʳ′ y
197197

198198
-- The last element in the list.
199199

@@ -326,3 +326,20 @@ private
326326
wordsBy (ℕ._≡ᵇ 1) (1231121 ∷ []) ≡
327327
(2 ∷⁺ [ 3 ]) ∷ [ 2 ] ∷ []
328328
wordsBy-≡1 = refl
329+
330+
------------------------------------------------------------------------
331+
-- DEPRECATED
332+
------------------------------------------------------------------------
333+
-- Please use the new names as continuing support for the old names is
334+
-- not guaranteed.
335+
336+
-- Version 1.4
337+
338+
infixl 5 _∷ʳ'_
339+
340+
_∷ʳ'_ : (xs : List A) (x : A) SnocView (xs ∷ʳ x)
341+
_∷ʳ'_ = SnocView._∷ʳ′_
342+
{-# WARNING_ON_USAGE _∷ʳ'_
343+
"Warning: _∷ʳ'_ (ending in an apostrophe) was deprecated in v1.4.
344+
Please use _∷ʳ′_ (ending in a prime) instead."
345+
#-}

src/Relation/Binary/Construct/StrictToNonStrict.agda

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ total <-tri x y with <-tri x y
9696
decidable : Decidable _≈_ Decidable _<_ Decidable _≤_
9797
decidable ≈-dec <-dec x y = <-dec x y ⊎-dec ≈-dec x y
9898

99-
decidable' : Trichotomous _≈_ _<_ Decidable _≤_
100-
decidable' compare x y with compare x y
99+
decidable : Trichotomous _≈_ _<_ Decidable _≤_
100+
decidable compare x y with compare x y
101101
... | tri< x<y _ _ = yes (inj₁ x<y)
102102
... | tri≈ _ x≈y _ = yes (inj₂ x≈y)
103103
... | tri> x≮y x≉y _ = no [ x≮y , x≉y ]′
@@ -139,6 +139,22 @@ isDecTotalOrder : IsStrictTotalOrder _≈_ _<_ → IsDecTotalOrder _≈_ _≤_
139139
isDecTotalOrder STO = record
140140
{ isTotalOrder = isTotalOrder STO
141141
; _≟_ = S._≟_
142-
; _≤?_ = decidable' S.compare
142+
; _≤?_ = decidable S.compare
143143
}
144144
where module S = IsStrictTotalOrder STO
145+
146+
147+
------------------------------------------------------------------------
148+
-- DEPRECATED
149+
------------------------------------------------------------------------
150+
-- Please use the new names as continuing support for the old names is
151+
-- not guaranteed.
152+
153+
-- Version 1.4
154+
155+
decidable' : Trichotomous _≈_ _<_ Decidable _≤_
156+
decidable' = decidable′
157+
{-# WARNING_ON_USAGE decidable'
158+
"Warning: decidable' (ending in an apostrophe) was deprecated in v1.4.
159+
Please use decidable′ (ending in a prime) instead."
160+
#-}

0 commit comments

Comments
 (0)