Changelog

How does $ work?

1
2
3
4
5
6
7
8
9
f ::  Int -> Int
f x = (sum [1..x])^2 - (sum . squares) x
			where
				squares x = map (\i -> i^2) [1..x]

f' ::  Int -> Int
f' x = (sum [1..x])^2 - sum $ squares x
			where
				squares x = map (\i -> i^2) [1..x]
2:7: Warning: Redundant bracket
Found:
(sum [1 .. x]) ^ 2
Why not:
sum [1 .. x] ^ 2
4:50: Warning: Avoid lambda
Found:
\ i -> i ^ 2
Why not:
(^ 2)
7:8: Warning: Redundant bracket
Found:
(sum [1 .. x]) ^ 2
Why not:
sum [1 .. x] ^ 2
9:50: Warning: Avoid lambda
Found:
\ i -> i ^ 2
Why not:
(^ 2)