I always wrote my recursive functions that produce a list in this format:
recursiveFunc :: [a] -> [b] recursiveFunc (x:xs) = [change x] ++ resursiveFunc xs where change :: a -> b change x = ...
I understand that any function like the one above can be written for the case a -> b
, and then just map
ed over the set [a]
, but please take this situation with irrigation as an example.
HLint suggests replacing [change x] ++ recursiveFunc xs
with change x : recursiveFunc xs
.
Is this proposal purely aesthetic, or is there any influence on how Haskell performs this function?
source share