This is the relevant code :
removeCard :: Card -> Tracker -> Tracker
removeCard card tracker = filter (\cTracker -> ctCard cTracker /= card) tracker
Haskell is giving me a warning here, saying it should be written without the tracker on each side. I find it easier to read my functions when all the arguments are there, as the argument names help clarify what the function does. I could reverse the order of the parameters, but it makes intuitive sense to me that if you're calling a removeCard function, the card to remove is the first parameter, so I don't want to do that either. Is there a strong argument in favor of removing the last parameter?
EDIT : The question originally said that Haskell was giving me an error, but that was a bug with Syntastic, it's just a warning.
If you don't want this HLint warning, you can disable it. This module will not show it for any functions defined:
module Foo where
{-# ANN module "HLint: ignore Eta reduce" #-}
foo bar = show bar
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments