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

Use only one Haskell pragma per line #305

Merged
merged 1 commit into from Feb 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions style/haskell/README.md
Expand Up @@ -5,13 +5,16 @@ Haskell

* Break long expressions before operators or keywords.
* Break long type signatures between arguments.
* Use a blank line between pragma and module statements.
* Order imports in three sections, separating each by a blank line:
[standard libraries], third-party libraries, application modules.
Within each section, alphabetize the imports and place qualified
imports last.
* Order pragma statements alphabetically.
* Use comma-first style exports, records, and lists.
* Use four-space indentation except the `where` keyword which is
indented two spaces. [Example].
* Use only one pragma statement per line.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add that they be alphabetized, or an additional rule for that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that they should. I added another bullet in the "Order" section.


[standard libraries]: http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
[Example]: /style/haskell/sample.hs#L41
3 changes: 3 additions & 0 deletions style/haskell/sample.hs
@@ -1,3 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that we need a rule about this, but I don't prefer this extra whitespace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it would be good to be consistent. I prefer the whitespace, but you've written and read more Haskell than I have, so I'll defer to you.

Updated with the space removed and a guideline not to include it.

module Haskell
( SomeType(..)
, someFunction
Expand Down