Skip to content

Commit aef9afc

Browse files
jamesmckinnaandreasabel
authored andcommitted
fixes #2390 (#2392)
1 parent c8a11e7 commit aef9afc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/style-guide.md

+28
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,34 @@ automate most of this.
229229
}
230230
```
231231

232+
#### Layout of initial `private` block
233+
234+
* Since the introduction of generalizable `variable`s (see below),
235+
this block provides a very useful way to 'fix'/standardise notation
236+
for the rest of the module, as well as introducing local
237+
instantiations of parameterised `module` definitions, again for the
238+
sake of fixing notation via qualified names.
239+
240+
* It should typically follow the `import` and `open` declarations, as
241+
above, separated by one blankline, and be followed by *two* blank
242+
lines ahead of the main module body.
243+
244+
* The current preferred layout is to use successive indentation by two spaces, eg.
245+
```agda
246+
private
247+
variable
248+
a : Level
249+
A : Set a
250+
```
251+
rather than to use the more permissive 'stacked' style, available
252+
since [agda/agda#5319](https://github.com/agda/agda/pull/5319).
253+
254+
* A possible exception to the above rule is when a *single* declaration
255+
is made, such as eg.
256+
```agda
257+
private open module M = ...
258+
```
259+
232260
#### Layout of `where` blocks
233261

234262
* `where` blocks are preferred rather than the `let` construction.

0 commit comments

Comments
 (0)