stylish-haskell
stylish-haskell copied to clipboard
Example formatted output in the Example section of README is not actually possible
I'm looking at the Example section in the README and that is exactly how I want my code to be formatted but it doesn't seem to be possible. The deriving (Show)
will only be put in a new line. Also, I can't find any way to get the first_field
to not be indented past the indentation level of the data constructor (Point
). Am I missing something or is this no longer possible?
Has this styling option been deliberately deprecated? If so, then sounds like the example needs to be updated. If it is still possible, I would love to know the configuration settings to achieve it.
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
module Bad where
import Control.Applicative ((<$>))
import System.Directory (doesFileExist)
import Data.Map (Map, keys, (!))
import qualified Data.Map as M
data Point = Point
{ pointX, pointY :: Double
, pointName :: String
} deriving (Show)
Looks like the example formatting that you cite, which I also use in all my projects, was first added here: https://github.com/haskell/stylish-haskell/pull/256
Then it was removed here: https://github.com/haskell/stylish-haskell/pull/266
There appears to have been no discussion of the fact that the #256 formatting went away.