ndmitchell / ndmitchell/hlint

Incorrect refactor of "Use forM_"

Open
#794 1 comment 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

Version: reproducible from master head (ac5a0047)
Minimal example:

import Data.Traversable -- /tmp/min.hs

main = forM [] print >> pure ()
$ stack exec -- hlint /tmp/min.hs 
min.hs:3:8: Warning: Use forM_
Found:
  forM [] print
Perhaps:
  forM_ [] print

1 hint

This refactor results in a compilation error because forM_ is not in scope - I would expect output message to inform me that I haven't brought any forM_ into scope yet.

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 issue with the provided Haskell example and the stack exec -- hlint /tmp/min.hs command, then trace the implementation of the “Use forM_” hint and refactor. Done means the suggested refactor does not produce an out-of-scope forM_, or clearly reports the required import.

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.