ndmitchell / ndmitchell/hlint

"functions" does not match qualified function names

Open
#582 3 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

Example rule in .hlint.yaml:

- functions:
  - {name: Data.List.nub, within: []}
  - {name: L.nub, within: []}
  - {name: nub, within: []}

Example code:

module Main (main) where

main :: IO ()
main = print $ nub [1, 1, 2, 2]

Running hlint on this program detects the use of the banned function nub. However, hlint fails to detect the use in the following program (which references nub using the qualified form L.hub):

module Main (main) where

import qualified Data.List as L

main :: IO ()
main = print $ L.nub [1, 1, 2, 2]

I'm using version 2.1.9 of hlint:

$ hlint --version
HLint v2.1.9, (C) Neil Mitchell 2006-2018

Is this expected behaviour?

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 with the .hlint.yaml rule and the two Haskell examples in the issue, then run HLint against each program to reproduce the difference between unqualified nub and qualified L.nub. Done means the functions rule consistently detects the qualified use named by its module alias.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.