ndmitchell / ndmitchell/hlint

Approximations when resolving qualified names

Open
#448 5 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

I have the following code:

import Universum

import Control.Monad.Except (MonadError (..))

foo = runExceptT

And I have this .hlint.yaml

- warn: { name: "Use 'runExceptT' from Universum"
        , lhs: Control.Monad.Except.runExceptT, rhs: Universum.runExceptT }

When I run hlint I get:

$ hlint example.hs 
example.hs:5:7: Warning: Use 'runExceptT' from Universum
Found:
  runExceptT
Why not:
  runExceptT

1 hint

But the thing is that runExceptT is exported from Universum here, because MonadError class doesn't even have runExceptT method, but hlint (probably because of wildcards) assumes that runExceptT is used from Control.Monad.Except module.
If I remove these (..) from import then `hlint doesn't throws any warnings.

I'm on 2.0.11 version of hlint.

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

Reproduce the report with the shown example.hs and .hlint.yaml using HLint 2.0.11, comparing imports with and without the (..) wildcard. Trace how the qualified names in the custom hint are resolved, then verify that HLint no longer emits the misleading warning while still recognizing a genuinely qualified-name match.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.