-- Return the greatest subarray sum within the array of integers passed in.
maxSequence :: [Int] -> Int
maxSequence = foldl1 max . map (foldl (+) 0) . foldl1 (++) . map inits . tails
maxSequence :: [Int] -> Int
maxSequence = foldl1 max . map (foldl (+) 0) . foldl1 (++) . map inits . tails
maxSequence = foldl1 max . map (foldl (+) 0) . foldl1 (++) . map inits . tails