D>Prelude GHC.Exts> let output = [ (the dept, sum salary) | (name, dept, salary) < D>- employees , then group by dept , then sortWith by (sum salary) , then take 5 ]