unicode-data icon indicating copy to clipboard operation
unicode-data copied to clipboard

Add code formatter

Open wismill opened this issue 3 years ago • 3 comments
trafficstars

Following this comment, it would be useful to use Formolu to ensure coding style.

wismill avatar Dec 20 '21 10:12 wismill

One hiccup that we saw in adopting fourmolu last time was that there was no way to format like this:

pollCounts
    :: MonadAsync m
    => (a -> Bool)
    -> (Stream m Int -> Stream m Int)
    -> Fold m Int b
    -> Stream m a
    -> Stream m a

It only supported putting the arrows at the end. We have codebase with this style and we have gotten used to it. We did not want to change that. Hopefully it might have support for this now.

harendra-kumar avatar Dec 20 '21 11:12 harendra-kumar

There is a PR, but not yet merged.

wismill avatar Dec 20 '21 12:12 wismill

Although not perfect, https://github.com/adithyaov/hindent/tree/composewell-style works for most cases. There are some known cases it does not work for but I manually fix them as it's much easier.

This is in no way a clean way to solve the problem of formatting though.

adithyaov avatar Dec 20 '21 21:12 adithyaov