lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
692 stars 72 forks source link

non-idempotency with comments inside monad/listcomps #31

Open lspitzner opened 7 years ago

lspitzner commented 7 years ago
func =
  [ abc x y
  | _ <- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
         -- comment
  , x <- bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  , y <- ccccccccccccccccccccccccccccccccccc
  ]

Each roundtrip through brittany will decrease the indentation of the comment.

Currently I cannot think of an easy fix on brittany's end for this because the ghc-exactprint interface is a bit unfortunate for this usecase. I have raised https://github.com/alanz/ghc-exactprint/issues/53.

tfausak commented 5 years ago

This seems like the opposite of #174 😆