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

style-guide rule for initial private block in modules #2392

Merged
merged 1 commit into from
May 30, 2024
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
28 changes: 28 additions & 0 deletions doc/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,34 @@ automate most of this.
}
```

#### Layout of initial `private` block

* Since the introduction of generalizable `variable`s (see below),
this block provides a very useful way to 'fix'/standardise notation
for the rest of the module, as well as introducing local
instantiations of parameterised `module` definitions, again for the
sake of fixing notation via qualified names.

* It should typically follow the `import` and `open` declarations, as
above, separated by one blankline, and be followed by *two* blank
lines ahead of the main module body.

* The current preferred layout is to use successive indentation by two spaces, eg.
```agda
private
variable
a : Level
A : Set a
```
rather than to use the more permissive 'stacked' style, available
since [agda/agda#5319](https://github.com/agda/agda/pull/5319).

* A possible exception to the above rule is when a *single* declaration
is made, such as eg.
```agda
private open module M = ...
```

#### Layout of `where` blocks

* `where` blocks are preferred rather than the `let` construction.
Expand Down
Loading