Hlint gets confused by `import Prelude ()`
Open
Nobody has claimed this yet.
scope
- Dominant language
- Haskell
- Stars
- 1.6k
- Forks
- 210
- PR merge metrics
- No merged PRs in 30d
Description
$ hlint --version
HLint v2.1.1, (C) Neil Mitchell 2006-2018
This seems to affect custom hints that don't use anything from Prelude (such as the wibble example in the defaults) as well.
Test1.hs
module Test where
import Prelude ()
f = concat $ map (+1) [1]
$ hlint Test.hs
No hints
But it's fine if NoImplicitPrelude is used instead
Test2.hs
{-# LANGUAGE NoImplicitPrelude #-}
module Test where
f = concat $ map (+1) [1]
$ hlint Test2.hs
Test2.hs:4:5: Warning: Use concatMap
Found:
concat $ map (+ 1) [1]
Why not:
concatMap (+ 1) [1]
1 hint
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided Test1.hs and Test2.hs examples, then trace how HLint handles import Prelude () versus NoImplicitPrelude. Done means the same applicable hints, including concatMap, are reported when Prelude is explicitly imported empty.
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
- Clearly specified
- Newbie friendliness
- 45/100