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

What about let bindings and let-in clauses? #17

Open
jubobs opened this issue Apr 7, 2015 · 0 comments
Open

What about let bindings and let-in clauses? #17

jubobs opened this issue Apr 7, 2015 · 0 comments

Comments

@jubobs
Copy link
Contributor

jubobs commented Apr 7, 2015

The style guide has recommendations for where bindings. What about let-in clauses?

In my opinion, the recommendation for if-then-else clauses,

Short cases should usually be put on a single line (when line length allows it).

also applies here. For longer let-in clauses, I favour the following style,

searchSpace d =
  let
    m = 10 ^ d - 1
    n = 10 ^ (d - 1)
  in
    [x * y | x <- [m, m - 1 .. n]
           , y <- [m, m - 1 .. x]]

i.e. Indent the let and in keyword two spaces to set them apart from the rest of the code and indent the definitions in a let clause and the body of an in clause 2 spaces. This is consistent with the style guidelines for where bindings.

Thoughts?

@jubobs jubobs changed the title What about let bindings? What about let bindings and let-in clauses? Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant