Exercise 5.6: Implemented append and flatMap for type Stream.