haskell / haskell/stylish-haskell

BangPatterns causing identifiers being split into multiple identifiers

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

Description

We have run into an issue with v0.10.0.0 where the code
```haskell
go (DoneH hdr rest) = case indexedToParser <$> toIndexed hdr (parseOrderedRecord @a) of
Left errMsg -> FailH rest errMsg
Right !cParser -> DoneH hdr (decodeWithP cParser opts rest)
```
is converted into
```haskell
go (DoneH hdr rest) = case indexedToParser <$> toIndexed hdr (parseOrderedRecord @a) of
Left errMsg -> FailH rest errMsg
Right !c Parser -> DoneH hdr (decodeWithP cParser opts rest)
```

breaking the identifier `!cParser` into `!c Parser`.

The file is being run with the following settings

```yaml
steps:
- simple_align:
cases: true
top_level_patterns: true
records: true

- imports:
align: global
list_align: after_alias
pad_module_names: false
long_list_align: new_line
empty_list_align: inherit
list_padding: 18
separate_lists: false
space_surround: false

- language_pragmas:
style: vertical
align: false
remove_redundant: true

- trailing_whitespace: {}

columns: 100
newline: native
language_extensions:
- DerivingStrategies
- DerivingVia
- FlexibleContexts
- GeneralizedNewtypeDeriving
- LambdaCase
- MultiParamTypeClasses
- QuasiQuotes
- RecordWildCards
- ScopedTypeVariables
- TemplateHaskell
- TupleSections
- BangPatterns
```
The same thing happens whether `BangPatterns` is in the list of `language_extensions` or not.

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.