How to ignore HLint hints?

I use HLint in my Haskell code, but not all warnings / errors are very useful. In particular, arrows are hinting because I never use arrows.

How do I get HLint to ignore all arrow hints?

+6
source share
1 answer

For example, if you have code:

map (\a -> (head a, length a)) someList 

HLint will print:

 Warning: Use &&& Found: \a -> (head a, length a) Why not: head Control.Arrow.&&& length 

Then you can ignore this by adding:

 {-# ANN module "HLint: ignore Use &&&" #-} 

At the top of the file. Alternatively, you can create ana.hlint file containing:

 ignore "Use &&&" 

Then use hlint like:

 > hlint --hint=ana.hlint source_code.hs 
+6
source

Source: https://habr.com/ru/post/984588/


All Articles