Permalink
Browse files

Clarify identation of if-then-else clauses in expressions

  • Loading branch information...
1 parent 6999aa0 commit 744e395c725a094c2c13b08a85db3015a7c16139 @tibbe committed Apr 9, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 haskell-style.md
View
@@ -158,6 +158,16 @@ Generally, guards and pattern matches should be preferred over if-then-else
clauses, where possible. Short cases should usually be put on a single line
(when line length allows it).
+When writing non-monadic code (i.e. when not using `do`) and guards
+and pattern matches can't be used, you can align if-then-else clauses
+you like you would normal expressions:
+
+```haskell
+foo = if ...
+ then ...
+ else ...
+```
+
Otherwise, you should be consistent with the 4-spaces indent rule, and the
`then` and the `else` keyword should be aligned. Examples:

0 comments on commit 744e395

Please sign in to comment.