-- Write a function, lastButOne, that returns the element before the last. lastButOne :: [a] -> [a] lastButOne xs = if null xs then xs else head (drop ((length xs) - 2) xs)