haskell / haskell/stylish-haskell

formatting values, rather than constructors

Open
#452 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
1k
Forks
153
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.