@@ -242,3 +242,55 @@ data A
242242
243243TODO: GADTs, record syntax, type families
244244
245+### Comments
246+
247+```Haskell
248+{- When a comment is not preceded with elements on the same line,
249+ they are indented as the elements in the enclosing AST node or
250+ braces/parenthesis/brackets.
251+ If it is between AST nodes, it is indented as the following
252+ node.
253+ If the end-of-file follows, then indent to column 0.
254+-}
255+
256+f = g {- When there are preceding elements, keep single-line comments in the same line. -}
257+
258+h = g
259+{- Multi-line comments can't be kept on the same line as @h = g@.
260+ Otherwise, changing h or g would change the indentation of all
261+ the comment lines.
262+ -}
263+
264+data R = R
265+ {- This comment always follows the R constructor -}
266+ { f1 :: T1
267+ {- A comment not preceded by other elements -}
268+ {- Another comment -}
269+ , f2 :: T2
270+ , f3 :: T3
271+ }
272+```
273+
274+```Haskell
275+{- a comment line -}
276+f = h
277+ where
278+ h = g
279+ -- indented the same as g
280+ g = False
281+```
282+
283+This example
284+```Haskell
285+data R = R {- This comment always follows the R constructor -}
286+ { f1 :: T1, {- An inner comment -} {- Another inner comment -} f2 :: T2, f3 :: T3}
287+```
288+is reformatted to
289+```Haskell
290+data R = R
291+ {- This comment always follows the R constructor -}
292+ { f1 :: T1 {- An inner comment -} {- Another inner comment -}
293+ , f2 :: T2
294+ , f3 :: T3
295+ }
296+```