Skip to content

Commit 4739d4a

Browse files
authored
Fix type for ≡-syntax in heterogeneous equality (#2494)
* fix type for ≡-syntax in heterogeneous equality * make ≡-syntax level polymorphic for heterogeneous equality * update CHANGELOG * move the entry in CHANGELOG to bug-fixes
1 parent 6078b64 commit 4739d4a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Bug-fixes
1111

1212
* Removed unnecessary parameter `#-trans : Transitive _#_` from
1313
`Relation.Binary.Reasoning.Base.Apartness`.
14+
* Relax the types for `≡-syntax` in `Relation.Binary.HeterogeneousEquality`.
15+
These operators are used for equational reasoning of heterogeneous equality
16+
`x ≅ y`, but previously the three operators in `≡-syntax` unnecessarily require
17+
`x` and `y` to have the same type, making them unusable in most situations.
1418

1519
Non-backwards compatible changes
1620
--------------------------------

src/Relation/Binary/HeterogeneousEquality.agda

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,22 +234,22 @@ module ≅-Reasoning where
234234

235235
infix 4 _IsRelatedTo_
236236

237-
data _IsRelatedTo_ {A : Set } {B : Set } (x : A) (y : B) : Set where
237+
data _IsRelatedTo_ {A : Set a} {B : Set b} (x : A) (y : B) : Set a where
238238
relTo : (x≅y : x ≅ y) x IsRelatedTo y
239239

240240
start : {x : A} {y : B} x IsRelatedTo y x ≅ y
241241
start (relTo x≅y) = x≅y
242242

243-
≡-go : {A : Set a} Trans {A = A} {C = A} _≡_ _IsRelatedTo_ _IsRelatedTo_
243+
≡-go : {A : Set a} {B : Set b} Trans {A = A} {C = B} _≡_ _IsRelatedTo_ _IsRelatedTo_
244244
≡-go x≡y (relTo y≅z) = relTo (trans (reflexive x≡y) y≅z)
245245

246246
-- Combinators with one heterogeneous relation
247-
module _ {A : Set } {B : Set } where
247+
module _ {A : Set a} {B : Set b} where
248248
open begin-syntax (_IsRelatedTo_ {A = A} {B}) start public
249+
open ≡-syntax (_IsRelatedTo_ {A = A} {B}) ≡-go public
249250

250251
-- Combinators with homogeneous relations
251-
module _ {A : Set ℓ} where
252-
open ≡-syntax (_IsRelatedTo_ {A = A}) ≡-go public
252+
module _ {A : Set a} where
253253
open end-syntax (_IsRelatedTo_ {A = A}) (relTo refl) public
254254

255255
-- Can't create syntax in the standard `Syntax` module for

0 commit comments

Comments
 (0)