import Data.List greet = ["Hello,", "yes", "this", "is", "dog."] main = print $ foldr1 (++) $ intersperse " " greet
Standard input is empty
"Hello, yes this is dog."
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!