Why does Haskell insist on removing the last argument of the function?

This is the corresponding code:

removeCard :: Card -> Tracker -> Tracker removeCard card tracker = filter (\cTracker -> ctCard cTracker /= card) tracker 

Haskell gives me a warning here, saying that this should be written without a tracker on each side. Itโ€™s easier for me to read my functions when all the arguments are there, since the argument names help clarify what the function does. I could change the order of the parameters, but it seems intuitive to me that if you call the removeCard function, the deleted card is the first parameter, so I donโ€™t want to do that either. Is there a good argument for removing the last parameter?

EDIT: The original question was that Haskell was giving me an error, but it was an error with Syntastic, this is just a warning.

+7
haskell
source share
1 answer

If you do not want this HLint warning, you can disable it. This module will not display it for certain functions:

 module Foo where {-# ANN module "HLint: ignore Eta reduce" #-} foo bar = show bar 
+12
source share

All Articles