Coq doesn't have an official style guide.
This is an attempt to write down the style that I follow while writing Coq code.
- Type annotations: Use
value: Typeformat- Note: Coq standard library seems to favour
value : Type, which is in line with Agda.
- Note: Coq standard library seems to favour
- Indendation: 2 spaces per level. Don't use tab.
- All imports should appear at the top of the file
- All
Reserved Notationlines should appear on top of the file, after the imports - Constructor names should start with uppercase
- Type names should start with lowercase.
- Module names should start with uppercase.
- Use
Contextinstead ofVariablefor sections
Suggestions:
- If there are more than 2 related notations, consider making a separate module just for them with its own scope.
- The module name should end with
Notations. - Eg:
RegexNotations
- The module name should end with
- Try to