haskell / haskell/stylish-haskell

Formatter drops unboxed tuples hashes

Open
#444 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

The formatter will reformat unboxed tuples to regular tuples by dropping the `#` character and removing necessary whitespace between the unboxed tuple and tuples elements. For example, the following type:

```haskell
import GHC.Exts (State#, RealWorld)

newtype T a = T { unT# :: State# RealWorld -> (# State# RealWorld, a #) }
```

would be reformatted as:

```haskell
newtype T a
= T { unT# :: State# RealWorld -> (State# RealWorld, a) }
```

I'm not sure if this is specific to certain configuration. The formatter will drop unboxed tuples even if:

- The `.stylish-haskell.yaml` option has `cabal: false` and `UnboxedTuples` listed under `language_extensions:`.
- The `UnboxedTuples` extension is listed under `default-extensions` in the package cabal file.
- A `{-# LANGUAGE UnboxedTuples #-}` pragma is added to the `*.hs` file containing the type `T`.

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.