Skip to content

Commit 1309c75

Browse files
Improve fixity declarations (#1228)
1 parent c1478b1 commit 1309c75

File tree

23 files changed

+125
-4
lines changed

23 files changed

+125
-4
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,3 +651,43 @@ Other minor additions
651651
```agda
652652
<-isDecStrictPartialOrder : IsDecPartialOrder _≈_ _≤_ → IsDecStrictPartialOrder _≈_ _<_
653653
```
654+
655+
* The following operators have had fixities assigneed:
656+
```
657+
infix 4 _[_] (Data.Graph.Acyclic)
658+
659+
infix 4 _∣?_ (Data.Integer.Divisibility.Signed)
660+
661+
infix 4 _∈_ _∉_ (Data.List.Fresh.Membership.Setoid)
662+
infixr 5 _∷_ (Data.List.Fresh.Relation.Unary.All)
663+
infixr 5 _∷_ _++_ (Data.List.Relation.Binary.Prefix.Heterogeneous)
664+
infix 4 _⊆?_ (Data.List.Relation.Binary.Sublist.DecSetoid)
665+
infix 4 _⊆I_ _⊆R_ _⊆T_ (Data.List.Relation.Binary.Sublist.Heterogeneous.Solver)
666+
infixr 8 _⇒_ (Data.List.Relation.Binary.Sublist.Propositional.Example.UniqueBoundVariables)
667+
infix 1 _⊢_~_▷_ (Data.List.Relation.Binary.Sublist.Propositional.Example.UniqueBoundVariables)
668+
infix 4 _++-mono_ (Data.List.Relation.Binary.Subset.Propositional.Properties)
669+
infix 4 _⊛-mono_ (Data.List.Relation.Binary.Subset.Propositional.Properties)
670+
infix 4 _⊗-mono_ (Data.List.Relation.Binary.Subset.Propositional.Properties)
671+
infixr 5 _++_ (Data.List.Relation.Binary.Suffix.Heterogeneous)
672+
infixr 5 _∷ˡ_ _∷ʳ_ (Data.List.Relation.Ternary.Interleaving)
673+
infix 1 _++_∷_ (Data.List.Relation.Unary.First)
674+
infixr 5 _∷_ (Data.List.Relation.Unary.First)
675+
676+
infix 4 _≥_ (Data.Nat.Binary.Base)
677+
infix 4 _<?_ _≟_ _≤?_ (Data.Nat.Binary.Properties)
678+
infixr 1 _∪-Fin_ (Data.Nat.InfinitelyOften)
679+
680+
infixr -1 _<$>_ (Function.Nary.NonDependent.Base)
681+
infix 1 _%=_⊢_ (Function.Nary.NonDependent.Base)
682+
infix 1 _∷=_⊢_ (Function.Nary.NonDependent.Base)
683+
684+
infixr 2 _⊗_ (Induction.Lexicographic)
685+
686+
infix 10 _⋆ (Relation.Binary.Construct.Closure.ReflexiveTransitive)
687+
infix 4 _≤_ (Relation.Binary.Construct.StrictToNonStrict)
688+
689+
infixr 6 _$ʳ_ (Tactic.RingSolver)
690+
infix -1 _$ᵉ_ (Tactic.RingSolver)
691+
infix 4 _⇓≟_ (Tactic.RingSolver)
692+
infixl 6 _⊜_ (Tactic.RingSolver.NonReflective)
693+
```

README/Design/Fixity.agda

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Documentation describing some of the fixity choices
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --without-K --safe #-}
8+
9+
-- There is no actual code in here, just design note.
10+
11+
module README.Design.Fixity where
12+
13+
14+
-- binary relations of all kinds are infix 4
15+
-- multiplication-like: infixl 7 _*_
16+
-- addition-like infixl 6 _+_
17+
-- negation-like infix 8 ¬_
18+
-- and-like infixr 7 _∧_
19+
-- or-like infixr 6 _∨_
20+
-- post-fix inverse infix 8 _⁻¹
21+
-- bind infixl 1 _>>=_
22+
-- list concat-like infixr 5 _∷_
23+
-- ternary reasoning infix 1 _⊢_≈_
24+
-- composition infixr 9 _∘_
25+
-- application infixr -1 _$_ _$!_
26+
27+
-- Reasoning:
28+
-- QED infix 3 _∎
29+
-- stepping infixr 2 _≡⟨⟩_ step-≡ step-≡˘
30+
-- begin infix 1 begin_
31+
32+
-- type formers:
33+
-- product-like infixr 2 _×_ _-×-_ _-,-_
34+
-- sum-like infixr 1 _⊎_

src/Data/Graph/Acyclic.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ module _ {ℓ e} {N : Set ℓ} {E : Set e} where
170170
-- Finds the context and remaining graph corresponding to a given node
171171
-- index.
172172

173+
infix 4 _[_]
174+
173175
_[_] : {n} Graph N E n (i : Fin n) Graph N E (suc (n - suc i))
174176
(c & g) [ zero ] = c & g
175177
(c & g) [ suc i ] = g [ i ]

src/Data/Integer/Divisibility/Signed.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ module ∣-Reasoning where
127127
------------------------------------------------------------------------
128128
-- Other properties of _∣_
129129

130+
infix 4 _∣?_
131+
130132
_∣?_ : Decidable _∣_
131133
k ∣? m = DEC.map′ ∣ᵤ⇒∣ ∣⇒∣ᵤ (∣ k ∣ ℕ.∣? ∣ m ∣)
132134

src/Data/List/Fresh/Membership/Setoid.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ open import Relation.Nullary
1717

1818
open Setoid S renaming (Carrier to A)
1919

20+
infix 4 _∈_ _∉_
21+
2022
private
2123
variable
2224
r : Level

src/Data/List/Fresh/Relation/Unary/All.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ private
2626

2727
module _ {A : Set a} {R : Rel A r} (P : Pred A p) where
2828

29+
infixr 5 _∷_
30+
2931
data All : List# A R Set (p ⊔ a ⊔ r) where
3032
[] : All []
3133
_∷_ : {x xs pr} P x All xs All (cons x xs pr)

src/Data/List/Relation/Binary/Prefix/Heterogeneous.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ open import Relation.Binary using (REL; _⇒_)
1717

1818
module _ {a b r} {A : Set a} {B : Set b} (R : REL A B r) where
1919

20+
infixr 5 _∷_ _++_
21+
2022
data Prefix : REL (List A) (List B) (a ⊔ b ⊔ r) where
2123
[] : {bs} Prefix [] bs
2224
_∷_ : {a b as bs} R a b Prefix as bs Prefix (a ∷ as) (b ∷ bs)

src/Data/List/Relation/Binary/Sublist/DecSetoid.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ open import Level using (_⊔_)
2222
open DecSetoid S
2323
open DecSetoidEquality S
2424

25+
infix 4 _⊆?_
26+
2527
------------------------------------------------------------------------
2628
-- Re-export core definitions
2729

src/Data/List/Relation/Binary/Sublist/Heterogeneous/Solver.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ open import Relation.Nullary
3737

3838
open P.≡-Reasoning
3939

40+
infix 4 _⊆I_ _⊆R_ _⊆T_
41+
4042
------------------------------------------------------------------------
4143
-- Reified list expressions
4244

src/Data/List/Relation/Binary/Sublist/Propositional/Example/UniqueBoundVariables.agda

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ open import Data.List.Relation.Binary.Sublist.Propositional.Properties using
3838

3939
open import Data.Product using (_,_; proj₁; proj₂)
4040

41+
infixr 8 _⇒_
42+
infix 1 _⊢_~_▷_
43+
4144
-- Simple types over a set Base of base types.
4245

4346
data Ty : Set where

0 commit comments

Comments
 (0)