Sections
Sections allow partial infix operators to be applied.
On the right:
(Ⓧ y) = \x -> x Ⓧ y
On the left:
(y Ⓧ) = \x -> y Ⓧ x
Examples:
doble = (* 2) -- == (2 *)
doble 5
10
map (* 2) [1, 2, 3] -- better than (\x -> x * 2) [1, 2, 3]
[2, 4, 6]
half = (/ 2) -- != (2 /)
half 6
3
isUppercase = (`elem` ['A' .. 'Z'])
isUppercase 'c'
False