ndmitchell / ndmitchell/hlint

GADTs are ignored in the newtype hint

Open
#697 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
1.6k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

ghc accepts both

data X where
  X :: Int -> X

and

newtype X where
  X :: Int -> X

but hlint doesn't suggest using a newtype in this case.

If it is desirable that hlint should make such a suggestion, then this seems easily solvable after/during #645.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing newtype hint implementation and issue #645, then check how hlint parses the shown GADT and newtype declarations accepted by ghc. Done means hlint consistently suggests newtype for the applicable GADT form, with coverage for the reported examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Feature
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.