How to disable hints on haskell-language-server

Viewed 711

haskell-language-server is giving me some hints on how to reduce code length, but while I'm learning I would like to disable this hints temporary so I can work on examples from books without the annoying hints polluting the editor. I still want error report, just disable the hints

Here is an example

enter image description here

1 Answers

EDIT: @JonPurdy mentioned (you should read the great comment bellow) that Hlint now supports plain comments like this too:

{- HLINT ignore "Use <$>" -}

unlike ANN there is no compile-time or embedding cost attached to this version and it can be placed anywhere - so it's probably the way to go if you need a comment-based solution.


you can disable Hlint warnings with either a comment in your file or using a hlint-config file (you can find more on both issues in the hlint manual

in this case here the line

{-# ANN module ("hlint: ignore Use <$>") #-}

after the import section in your file should disable the warning for the module (note that it needs to be after the imports - you'll get an parser error otherwise).


how to use a file

normaly you can create / add those to a .hlint.yaml like bellow but as of the comment from @Hjulle this will probably not work.


  • start by doing hlint . --default > .hlint.yaml from your console - you should get the file

  • find the section # Ignore some buildint hints - you see an example

  • add the - ignore: { name: Use <$> } option

with this a hlint src no longer will show the warning

For VS.Code / LSP it does sadly not work (yet I hope)

Related