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

Consistency of haskell code style #200

Closed
ivanperez-keera opened this issue Mar 17, 2022 · 1 comment
Closed

Consistency of haskell code style #200

ivanperez-keera opened this issue Mar 17, 2022 · 1 comment
Assignees
Milestone

Comments

@ivanperez-keera
Copy link
Owner

Starting from this comment, I have looked at this Haskell style guide.

I don't want the perfect to get in the way of the good. Progress in this direction will help. Therefore, I'm only going to ask for mandatory rules for now.

Once that is implemented, perhaps we can select some suggestions or optional rules and implement those as well.

@ivanperez-keera
Copy link
Owner Author

ivanperez-keera commented Mar 17, 2022

There are a few style conventions that I would like to apply as well.

These are suggestions, and, consistent with my previous comment, I won't apply them now, but perhaps a future issue could address them:

  • Column limit.
  • Standard indentation.
  • Removal of commented code, unnecessary comments.
  • Spaces after commas.
  • Align lists (exports, etc.) by comma.

ivanperez-keera added a commit that referenced this issue Mar 17, 2022
…3). Refs #200.

Rule: No blank lines separate pragmas, the module haddock declaration,
and the module declaration. Exactly one blank line separates the module
declaration from the imports sec- tion, and the imports section from the
definitions section.
ivanperez-keera added a commit that referenced this issue Mar 17, 2022
Rule: imports belonging to the same group should be listed in
alphabetical order.

Rule: elements imported from a module should be listed in alphabetical
order.

Note: the tool used to sort imports, style-haskell, aligns the opening
brackets and also leaves a space before any opening parentheses. This is
not required by the rule; standarization of that aspect may result from
the application of a different rule.
ivanperez-keera added a commit that referenced this issue Mar 17, 2022
Rule: Do not leave any empty lines at the end of the file.
ivanperez-keera added a commit that referenced this issue Mar 17, 2022
Rule: Horizontal alignment is required in the following:

- For the module names and lists of imported symbols in contiguous
import declarations.
ivanperez-keera added a commit that referenced this issue Mar 17, 2022
…#200.

Rule: Comments must always be line comments, except for pragmas and GHC
options, which can be listed as block comments.
ivanperez-keera added a commit that referenced this issue Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant