Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add style-guide note about local suffix #2109

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions notes/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,16 @@ word within a compound word is capitalized except for the first word.
map⁻ : Pointwise R (map f as) (map g bs) → Pointwise (λ a b → R (f a) (g b)) as bs
```

* When specifying a property over a container, there are usually two choices. Either
assume the property holds for generally (e.g. `map id xs ≡ xs`) or a assume that
it only holds for the elements within the container (e.g. `All (λ x → f x ≡ x) xs → map f xs ≡ xs`).
The naming convention is to add a `-local` suffix on to the name of the latter variety.
e.g.
```agda
map-id : map id xs ≡ xs
map-id-local : All (λ x → f x ≡ x) xs → map f xs ≡ xs
```

#### Keywords

* If the name of something clashes with a keyword in Agda, then convention
Expand Down