composewell / unicode-data

Access unicode character database
Apache License 2.0
18 stars 6 forks source link

Add code formatter #49

Open wismill opened 2 years ago

wismill commented 2 years ago

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

harendra-kumar commented 2 years ago

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.

wismill commented 2 years ago

There is a PR, but not yet merged.

adithyaov commented 2 years ago

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.