haskell / haskell/stylish-haskell

Parser errors for `newtype` GADTs

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

Description

Attempting to format a `newtype` with `-XGADTSyntax` or `-XGADTs` such as:

```haskell
import Data.Kind

newtype T (a :: Type) :: Type where
T :: {unT :: a -> a} -> T a
```

fails for `stylish-haskell-0.14.3.0` with the following error:

```
CallStack (from HasCallStack):
error, called at lib/Language/Haskell/Stylish/Step/Data.hs:463:5 in stylish-haskell-0.14.3.0:Language.Haskell.Stylish.Step.Data
```

The failure is due to [this line](https://github.com/haskell/stylish-haskell/blob/46abf7900270a66f74fd4bf7da830475bccbca04/lib/Language/Haskell/Stylish/Step/Data.hs#L463).

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.