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

Marcus Buffett

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.

that other guy

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.

edited at
0

Comments

0 comments
Login to comment

Related

Why does Wine insist on removing systemd?

Why function is the first argument in Haskell

Why xargs does not process the last argument?

Why does Samba insist on logging on as a guest user?

Why does the makefile insist on compiling things it should not?

Why does aptitude insist on installing packages?

Why does NodeJS/Javascript insist these variables are undefined?

Why does gcc infer the type from the callback function's last argument here?

Why does this function returns the last argument when called right after definition

Removing the last element of a list: Why does ".pop() not work?

Why is my function not removing the last occurrence of elements from the list?

Why does {} as function argument not lead to ambiguity?

Why does the default argument not work in a template function?

Golang - Why does this function change the input argument?

Why does my function assume a missing argument is there?

Why does first argument of `Function` deny parentheses?

Why does function c() accept an undocumented argument?

Why does Haskell want this function's argument to have the type classes (RealFrac x, Integral x) when it only needs to be Integral x?

Why does Haskell use arrows for the type of a function?

Why does this Haskell TCP server generate an `invalid argument` error with accept?

Why does a list of arguments wrapped in braces return the last argument?

Why is my Haskell function argument required to be of type Bool?

Why haskell seq function makes first argument to WHNF?

Haskell >>= operation: why is the function argument required to return another Monad?

Why does my route insist on being GET, when it ~should~ be PUT

Why does the build insist on looking for Scala 2.10 version of dependencies?

Why does Mac OS X insist on changing my MTU to 1500?

Why does TextBox Border Colour insist on and not changing in WPF?

Why does Android Studio insist that I make this void?