Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect suggestions with OverloadedLists #114

Closed
expipiplus1 opened this issue Feb 22, 2015 · 1 comment · Fixed by #1273
Closed

Incorrect suggestions with OverloadedLists #114

expipiplus1 opened this issue Feb 22, 2015 · 1 comment · Fixed by #1273

Comments

@expipiplus1
Copy link
Contributor

{-# LANGUAGE OverloadedLists #-}
module Baz where

import Data.Foldable

foo :: Foldable t => t a -> t a
foo = id

bar = foo (True:[])

HLint suggests:

Warning: Use list literal
Found:
  True : []
Why not:
  [True]

This will prevent the program from typechecking due to the ambiguity introduced by OverloadedLists

@ndmitchell
Copy link
Owner

Thanks for the report. I guess removing (:) takes you to the generalisation. I guess I should check for overloaded lists and not suggest the replacement.

kk-hainq added a commit to MELD-labs/hlint that referenced this issue Aug 5, 2021
kk-hainq added a commit to MELD-labs/hlint that referenced this issue Aug 29, 2021
ndmitchell added a commit that referenced this issue Aug 29, 2021
Fix OverloadedLists suggestion as documented in #114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants