haskell / haskell/stylish-haskell

newtypes are formatted on two lines with break_single_constructors: false

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

Description

As `newtype`s always have a single constructor, you would think that they
would obey `break_single_constructors`. However, with that set to false,
```haskell
newtype Foo = Foo Int
```
becomes
```haskell
newtype Foo
= Foo Int
```

while `data` with a single constructor stay on one line.
```haskell
data Foo = Foo Int
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the formatter logic for Haskell newtype declarations and the break_single_constructors option, then compare it with single-constructor data handling. Reproduce the issue using the Foo examples from the report; done means break_single_constructors: false keeps the newtype on one line, with a regression test covering the output.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.