Skip to content

Commit b39dcc5

Browse files
authored
Make _<″_/_≤″_ inversions more lazy (#2449)
* make `_<″_`/`_≤″_` inversions more lazy * correct deprecation warning * correct deprecation warning
1 parent ebed040 commit b39dcc5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Data/Nat/Base.agda

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ open import Data.Parity.Base using (Parity; 0ℙ; 1ℙ)
1818
open import Level using (0ℓ)
1919
open import Relation.Binary.Core using (Rel)
2020
open import Relation.Binary.PropositionalEquality.Core
21-
using (_≡_; _≢_; refl)
21+
using (_≡_; _≢_; refl; cong)
2222
open import Relation.Nullary.Negation.Core using (¬_; contradiction)
2323
open import Relation.Unary using (Pred)
2424

@@ -375,7 +375,7 @@ m >″ n = n <″ m
375375
-- Smart destructor of _<″_
376376

377377
s<″s⁻¹ : {m n} suc m <″ suc n m <″ n
378-
s<″s⁻¹ (k , refl) = k , refl
378+
s<″s⁻¹ (k , eq) = k , cong pred eq
379379

380380
-- _≤‴_: this definition is useful for induction with an upper bound.
381381

@@ -435,10 +435,10 @@ pattern <″-offset k = k , refl
435435
"Warning: <″-offset was deprecated in v2.1. Please match directly on proofs of ≤″ using pattern (_, refl) from Algebra.Definitions.RawMagma._∣ˡ_ instead. "
436436
#-}
437437

438-
-- Smart destructors of _<″_
438+
-- Smart destructor of _″_
439439

440440
s≤″s⁻¹ : {m n} suc m ≤″ suc n m ≤″ n
441-
s≤″s⁻¹ (k , refl) = k , refl
441+
s≤″s⁻¹ (k , eq) = k , cong pred eq
442442
{-# WARNING_ON_USAGE s≤″s⁻¹
443-
"Warning: s≤″s⁻¹ was deprecated in v2.1. Please match directly on proofs of ≤″ using pattern (_, refl) from Algebra.Definitions.RawMagma._∣ˡ_ instead. "
443+
"Warning: s≤″s⁻¹ was deprecated in v2.1. Please match directly on proofs of ≤″ using constructor Algebra.Definitions.RawMagma._∣ˡ_._,_ instead. "
444444
#-}

0 commit comments

Comments
 (0)