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.
The style guide has recommendations for
where
bindings. What aboutlet
-in
clauses?In my opinion, the recommendation for
if
-then
-else
clauses,also applies here. For longer
let
-in
clauses, I favour the following style,i.e. Indent the
let
andin
keyword two spaces to set them apart from the rest of the code and indent the definitions in alet
clause and the body of anin
clause 2 spaces. This is consistent with the style guidelines forwhere
bindings.Thoughts?