@@ -242,3 +242,55 @@ data A
243TODO: GADTs, record syntax, type families
243TODO: GADTs, record syntax, type families
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
253+ If the end-of-file follows, then indent to column 0.
256+f = g {- When there are preceding elements, keep single-line comments in the same line. -}
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
265+ {- This comment always follows the R constructor -}
267+ {- A comment not preceded by other elements -}
268+ {- Another comment -}
279+ -- indented the same as g
285+data R = R {- This comment always follows the R constructor -}
286+ { f1 :: T1, {- An inner comment -} {- Another inner comment -} f2 :: T2, f3 :: T3}
291+ {- This comment always follows the R constructor -}
292+ { f1 :: T1 {- An inner comment -} {- Another inner comment -}