Skip to content

Commit 48e3a34

Browse files
Saransh-cppplt-amy
authored andcommitted
Fixities for Function, Data, and Reflection (#1987)
1 parent 16ed558 commit 48e3a34

File tree

19 files changed

+65
-5
lines changed

19 files changed

+65
-5
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,27 @@ Bug-fixes
3131

3232
* The following operators were missing a fixity declaration, which has now
3333
been fixed -
34-
```
34+
```
35+
infix -1 _$ⁿ_ (Data.Vec.N-ary)
36+
infix 4 _≋_ (Data.Vec.Functional.Relation.Binary.Equality.Setoid)
37+
infix 4 _≟_ (Reflection.AST.Definition)
38+
infix 4 _≡ᵇ_ (Reflection.AST.Literal)
39+
infix 4 _≈?_ _≟_ _≈_ (Reflection.AST.Meta)
40+
infix 4 _≈?_ _≟_ _≈_ (Reflection.AST.Name)
41+
infix 4 _≟-Telescope_ (Reflection.AST.Term)
42+
infix 4 _≟_ (Reflection.AST.Argument.Information)
43+
infix 4 _≟_ (Reflection.AST.Argument.Modality)
44+
infix 4 _≟_ (Reflection.AST.Argument.Quantity)
45+
infix 4 _≟_ (Reflection.AST.Argument.Relevance)
46+
infix 4 _≟_ (Reflection.AST.Argument.Visibility)
47+
infixr 8 _^_ (Function.Endomorphism.Propositional)
48+
infixr 8 _^_ (Function.Endomorphism.Setoid)
49+
infix 4 _≃_ (Function.HalfAdjointEquivalence)
50+
infix 4 _≈_ _≈ᵢ_ _≤_ (Function.Metric.Bundles)
51+
infixl 6 _∙_ (Function.Metric.Bundles)
52+
infix 4 _≈_ (Function.Metric.Nat.Bundles)
53+
infix 3 _←_ _↢_ (Function.Related)
54+
3555
infix 4 _ℕ<_ _ℕ≤infinity _ℕ≤_ (Codata.Sized.Conat)
3656
infix 6 _ℕ+_ _+ℕ_ (Codata.Sized.Conat)
3757
infixl 4 _+ _* (Data.List.Kleene.Base)

src/Data/Vec/Functional/Relation/Binary/Equality/Setoid.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ open Setoid S renaming (Carrier to A)
2424
-- Definition
2525
------------------------------------------------------------------------
2626

27+
infix 4 _≋_
28+
2729
_≋_ : {n} Vector A n Vector A n Set
2830
_≋_ = Pointwise _≈_
2931

src/Data/Vec/N-ary.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ curryⁿ : ∀ {n} → (Vec A n → B) → N-ary n A B
4545
curryⁿ {n = zero} f = f []
4646
curryⁿ {n = suc n} f = λ x curryⁿ (f ∘ _∷_ x)
4747

48+
infix -1 _$ⁿ_
49+
4850
_$ⁿ_ : {n} N-ary n A B (Vec A n B)
4951
f $ⁿ [] = f
5052
f $ⁿ (x ∷ xs) = f x $ⁿ xs

src/Function/Endomorphism/Propositional.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ toSetoidEndo f = record
4343
------------------------------------------------------------------------
4444
-- N-th composition
4545

46+
infixr 8 _^_
47+
4648
_^_ : Endo Endo
4749
f ^ zero = id
4850
f ^ suc n = f ∘′ (f ^ n)

src/Function/Endomorphism/Setoid.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private
3535
Endo : Set _
3636
Endo = S ⟶ S
3737

38+
infixr 8 _^_
39+
3840
_^_ : Endo Endo
3941
f ^ zero = id
4042
f ^ suc n = f ∘ (f ^ n)

src/Function/HalfAdjointEquivalence.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ open import Relation.Binary.PropositionalEquality
1616

1717
-- Half adjoint equivalences (see the HoTT book).
1818

19+
infix 4 _≃_
20+
1921
record _≃_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where
2022
field
2123
to : A B

src/Function/Metric/Bundles.agda

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ open import Function.Metric.Core
2222

2323
record ProtoMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
2424
: Set (suc (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃)) where
25+
infix 4 _≈_ _≈ᵢ_ _≤_
2526
field
2627
Carrier : Set a
2728
Image : Set i
@@ -39,6 +40,7 @@ record ProtoMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
3940

4041
record PreMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
4142
: Set (suc (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃)) where
43+
infix 4 _≈_ _≈ᵢ_ _≤_
4244
field
4345
Carrier : Set a
4446
Image : Set i
@@ -61,6 +63,8 @@ record PreMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
6163

6264
record QuasiSemiMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
6365
: Set (suc (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃)) where
66+
67+
infix 4 _≈_ _≈ᵢ_ _≤_
6468
field
6569
Carrier : Set a
6670
Image : Set i
@@ -86,6 +90,7 @@ record QuasiSemiMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
8690

8791
record SemiMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
8892
: Set (suc (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃)) where
93+
infix 4 _≈_ _≈ᵢ_ _≤_
8994
field
9095
Carrier : Set a
9196
Image : Set i
@@ -120,6 +125,8 @@ record SemiMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
120125

121126
record GeneralMetric (a i ℓ₁ ℓ₂ ℓ₃ : Level)
122127
: Set (suc (a ⊔ i ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃)) where
128+
infix 4 _≈_ _≈ᵢ_ _≤_
129+
infixl 6 _∙_
123130
field
124131
Carrier : Set a
125132
Image : Set i

src/Function/Metric/Nat/Bundles.agda

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ open import Function.Metric.Bundles as Base
2828
-- Proto-metric
2929

3030
record ProtoMetric a ℓ : Set (suc (a ⊔ ℓ)) where
31+
infix 4 _≈_
3132
field
3233
Carrier : Set a
3334
_≈_ : Rel Carrier ℓ
@@ -40,6 +41,7 @@ record ProtoMetric a ℓ : Set (suc (a ⊔ ℓ)) where
4041
-- PreMetric
4142

4243
record PreMetric a ℓ : Set (suc (a ⊔ ℓ)) where
44+
infix 4 _≈_
4345
field
4446
Carrier : Set a
4547
_≈_ : Rel Carrier ℓ
@@ -57,6 +59,7 @@ record PreMetric a ℓ : Set (suc (a ⊔ ℓ)) where
5759
-- QuasiSemiMetric
5860

5961
record QuasiSemiMetric a ℓ : Set (suc (a ⊔ ℓ)) where
62+
infix 4 _≈_
6063
field
6164
Carrier : Set a
6265
_≈_ : Rel Carrier ℓ
@@ -77,6 +80,7 @@ record QuasiSemiMetric a ℓ : Set (suc (a ⊔ ℓ)) where
7780
-- SemiMetric
7881

7982
record SemiMetric a ℓ : Set (suc (a ⊔ ℓ)) where
83+
infix 4 _≈_
8084
field
8185
Carrier : Set a
8286
_≈_ : Rel Carrier ℓ
@@ -97,6 +101,7 @@ record SemiMetric a ℓ : Set (suc (a ⊔ ℓ)) where
97101
-- Metrics
98102

99103
record Metric a ℓ : Set (suc (a ⊔ ℓ)) where
104+
infix 4 _≈_
100105
field
101106
Carrier : Set a
102107
_≈_ : Rel Carrier ℓ
@@ -117,6 +122,7 @@ record Metric a ℓ : Set (suc (a ⊔ ℓ)) where
117122
-- UltraMetrics
118123

119124
record UltraMetric a ℓ : Set (suc (a ⊔ ℓ)) where
125+
infix 4 _≈_
120126
field
121127
Carrier : Set a
122128
_≈_ : Rel Carrier ℓ

src/Function/Related.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ open R public using
5353
-- (which implies that Agda can deduce the universe code from an
5454
-- expression matching any of the right-hand sides).
5555

56+
infix 3 _←_ _↢_
57+
5658
record _←_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where
5759
constructor lam
5860
field app-← : B A

src/Reflection/AST/Argument/Information.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ arg-info-injective₂ refl = refl
4848
arg-info-injective : arg-info v m ≡ arg-info v′ m′ v ≡ v′ × m ≡ m′
4949
arg-info-injective = < arg-info-injective₁ , arg-info-injective₂ >
5050

51+
infix 4 _≟_
52+
5153
_≟_ : DecidableEquality ArgInfo
5254
arg-info v m ≟ arg-info v′ m′ =
5355
map′

src/Reflection/AST/Argument/Modality.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ modality-injective₂ refl = refl
4848
modality-injective : modality r q ≡ modality r′ q′ r ≡ r′ × q ≡ q′
4949
modality-injective = < modality-injective₁ , modality-injective₂ >
5050

51+
infix 4 _≟_
52+
5153
_≟_ : DecidableEquality Modality
5254
modality r q ≟ modality r′ q′ =
5355
map′

src/Reflection/AST/Argument/Quantity.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ open Quantity public
2121
------------------------------------------------------------------------
2222
-- Decidable equality
2323

24+
infix 4 _≟_
25+
2426
_≟_ : DecidableEquality Quantity
2527
quantity-ω ≟ quantity-ω = yes refl
2628
quantity-0 ≟ quantity-0 = yes refl

src/Reflection/AST/Argument/Relevance.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ open Relevance public
2121
------------------------------------------------------------------------
2222
-- Decidable equality
2323

24+
infix 4 _≟_
25+
2426
_≟_ : DecidableEquality Relevance
2527
relevant ≟ relevant = yes refl
2628
irrelevant ≟ irrelevant = yes refl

src/Reflection/AST/Argument/Visibility.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ open Visibility public
2121
------------------------------------------------------------------------
2222
-- Decidable equality
2323

24+
infix 4 _≟_
25+
2426
_≟_ : DecidableEquality Visibility
2527
visible ≟ visible = yes refl
2628
hidden ≟ hidden = yes refl

src/Reflection/AST/Definition.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ record′-injective = < record′-injective₁ , record′-injective₂ >
5959
constructor′-injective : {c c′} constructor′ c ≡ constructor′ c′ c ≡ c′
6060
constructor′-injective refl = refl
6161

62+
infix 4 _≟_
63+
6264
_≟_ : DecidableEquality Definition
6365
function cs ≟ function cs′ =
6466
map′ (cong function) function-injective (cs Term.≟-Clauses cs′)

src/Reflection/AST/Literal.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,7 @@ meta x ≟ string x₁ = no (λ ())
104104
meta x ≟ name x₁ = no (λ ())
105105
meta x ≟ meta x₁ = map′ (cong meta) meta-injective (x Meta.≟ x₁)
106106

107+
infix 4 _≡ᵇ_
108+
107109
_≡ᵇ_ : Literal Literal Bool
108110
l ≡ᵇ l′ = isYes (l ≟ l′)

src/Reflection/AST/Meta.agda

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ open import Agda.Builtin.Reflection.Properties public
2323

2424
-- Equality of metas is decidable.
2525

26+
infix 4 _≈?_ _≟_ _≈_
27+
2628
_≈_ : Rel Meta _
2729
_≈_ = _≡_ on toℕ
2830

2931
_≈?_ : Decidable _≈_
3032
_≈?_ = On.decidable toℕ _≡_ ℕₚ._≟_
3133

32-
infix 4 _≟_
3334
_≟_ : DecidableEquality Meta
3435
m ≟ n = map′ (toℕ-injective _ _) (cong toℕ) (m ≈? n)

src/Reflection/AST/Name.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Names = List Name
3737
-- Decidable equality for names
3838
----------------------------------------------------------------------
3939

40+
infix 4 _≈?_ _≟_ _≈_
41+
4042
_≈_ : Rel Name _
4143
_≈_ = _≡_ on toWords
4244

43-
infix 4 _≈?_ _≟_
44-
4545
_≈?_ : Decidable _≈_
4646
_≈?_ = decidable toWords _≡_ (Prodₚ.≡-dec Wₚ._≟_ Wₚ._≟_)
4747

src/Reflection/AST/Term.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ absurd-clause-injective = < absurd-clause-injective₁ , absurd-clause-injective
128128

129129
infix 4 _≟-AbsTerm_ _≟-AbsType_ _≟-ArgTerm_ _≟-ArgType_ _≟-Args_
130130
_≟-Clause_ _≟-Clauses_ _≟_
131-
_≟-Sort_ _≟-Pattern_ _≟-Patterns_
131+
_≟-Sort_ _≟-Pattern_ _≟-Patterns_ _≟-Telescope_
132132

133133
_≟-AbsTerm_ : DecidableEquality (Abs Term)
134134
_≟-AbsType_ : DecidableEquality (Abs Type)

0 commit comments

Comments
 (0)