Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatting values, rather than constructors #452

Open
peterbecich opened this issue Mar 18, 2023 · 0 comments
Open

formatting values, rather than constructors #452

peterbecich opened this issue Mar 18, 2023 · 0 comments

Comments

@peterbecich
Copy link
Member

Can Stylish Haskell format values?

I am trying to format this value:

psBool :: PSType
psBool = TypeInfo
    { _typePackage = "",
      _typeModule = "Prim",
      _typeName = "Boolean",
      _typeParameters = []
    }

It appears Stylish Haskell ignores it and does not format it.

Here is a constructor definition with a bunch of formatting problems:

-- | Basic info about a data type:
data TypeInfo (lang :: Language) = TypeInfo
  { -- | Hackage package
    _typePackage    :: !Text,
    -- | Full Module path
    _typeModule     :: !Text,  _typeName       :: !Text
    ,        _typeParameters :: ![TypeInfo lang]
  }
  deriving (Eq, Ord,       Show)

and Stylish Haskell formats it perfectly:

-- | Basic info about a data type:
data TypeInfo (lang :: Language)
  = TypeInfo
      { -- | Hackage package
        _typePackage    :: !Text
        -- | Full Module path
      , _typeModule     :: !Text
      , _typeName       :: !Text
      , _typeParameters :: ![TypeInfo lang]
      }
  deriving (Eq, Ord, Show)

stylish-haskell 0.14.4.0

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant