When running hlint over the weightDelta
function is keeps suggesting Eta reduce. I read another related Eta reduce question, but I can't seem to transfer the understanding into this case.
module StackQuestion where
import qualified Data.Vector as V
type Weights = V.Vector Double
type LearningRate = Double
weightDelta :: LearningRate -> Double -> Double -> Weights -> Weights
weightDelta n r y ws = V.map update ws
where update w = diff * n * w
diff = r - y
Every change I try to make to "reduce" it to point free syntax just breaks it. Where's the change to be made, and is there any sort of intuition or trick to avoid an eta reduce suggestion in the future?