Example of processing lists in Haskell