ndmitchell / ndmitchell/hlint

Spurious warnings for redefined function in v1.9,41

Open
#310 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Unlike in v1.9.35, when I have a custom functions called liftA, liftB, ... hlint thinks I am trying to use Control.Applicative.liftA (despite the fact the types do not match) and suggests using fmap.

liftA :: Show a => a
liftA = undefined
main = print liftA

output (v1.9.35)

No hints

output (v1.9.41)

Example.hs:4:14: Warning: Use fmap
Found:
  liftA
Why not:
  fmap
1 hint

same is true for 49300cd11131f11ec300a6d6a984a197a1d48895

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

Start by reproducing the reported example with hlint v1.9.35 and v1.9.41, then compare the behavior at commit 49300cd11131f11ec300a6d6a984a197a1d48895. The issue is done when the custom liftA definition no longer produces the Use fmap warning, while genuine Control.Applicative.liftA cases still behave correctly.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.