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

Add options to format export lists

Open vrom911 opened this issue 7 years ago • 4 comments

I guess it could be made in a similar manner as for imports: options for the padding, spaces after brackets or probably any better ideas.

vrom911 avatar Sep 06 '18 06:09 vrom911

You mean like when module exports stuff

module Foo where
  ( bar
  , baz)

?

EncodePanda avatar Jan 23 '20 11:01 EncodePanda

Yes, exactly. I still think that this could be extremely useful :slightly_smiling_face:

Some people prefer to align as you mentioned:

module Foo
    ( bar
    , baz
    ) 
    where

while others would want to do something like this:

module Foo where
       ( bar
       , baz
       ) where

It would be nice to have this automatically and configurable.

Some concerns I can see are related to Main module. usually you do:

module Main (main) where

but not

module Main 
    ( main
    ) where

However, I am not sure if this should be handled separately.

vrom911 avatar Jan 23 '20 12:01 vrom911

considered it done (if possible :) )

EncodePanda avatar Jan 23 '20 16:01 EncodePanda

hey @vrom911 I'm happy to report that this feature was added few versions ago and was additionally polished recently here https://github.com/haskell/stylish-haskell/pull/357 (not yet released). Please have a look and close the ticket if you think that this is what you were hoping to get.

EncodePanda avatar Apr 23 '21 22:04 EncodePanda