stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

Utrecht style commas?

Open gregorycollins opened this issue 11 years ago • 10 comments

How much work is it to use Utrecht-style commas in the import lists?

gregorycollins avatar Nov 15 '12 16:11 gregorycollins

Not that hard, I'll try to fix it this week.

jaspervdj avatar Nov 19 '12 09:11 jaspervdj

Could you give a specific example of the preferred style? I'm not sure what I should do with the closing ), should it always be on a separate line?

jaspervdj avatar Nov 20 '12 15:11 jaspervdj

import           Foo  ( foo
                      , bar
                      , baz
                      , quux
                      )

It's always on a separate line in Utrecht style IIRC.

gregorycollins avatar Nov 20 '12 16:11 gregorycollins

This would be nice to have! Though i'm not sure if I prefer an import on each line or like this:

import           Foo  ( foo, bar
                      , baz, quux
                      )

I saw that there was a branch for this, what's the status of it @jaspervdj? No pressure :)

bergmark avatar Aug 15 '13 17:08 bergmark

Is this fixed somehow? I whould be very interested in this.

pmiddend avatar Aug 09 '14 14:08 pmiddend

No it's not fixed. I have a fork that does utrecht formatting for language pragmas, would be nice to be able to merge this (related: #64) but it's quite some work I'd imagine.

bergmark avatar Aug 09 '14 14:08 bergmark

Hi @jaspervdj I just checked this and it looks like it's not been done yet. In fact, I can simply use a mix of trailing and leading commas and stylish-haskell doesn't change anything. Is this the expected behavior?

SuhairZain avatar Nov 24 '16 12:11 SuhairZain

A little surprised this isn't implemented, yet. But, I also don't have time to dig into it right now.

Thanks for a great tool, @jaspervdj .

stephen-smith avatar Sep 25 '19 21:09 stephen-smith

This is indeed still not implemented; I don't use this style myself and don't really have time to implement it right now, but I would welcome a PR adding it.

jaspervdj avatar Oct 08 '19 09:10 jaspervdj

If anyone here is willing to contribute example formatting output by (failing) tests, I would be happy to pick it up (implement, making test green).

EncodePanda avatar Jan 23 '20 17:01 EncodePanda