I am trying to print the elements of my list onto new lines, but i cant get it to work;
printElements :: [String] -> IO()
printElements (x:xs) = print x
Instead of explicit recursion, you can use mapM_ to call putStrLn for every element. It works like the regular map for lists, but is used with a monadic function (thus the "M"). The underscore variant is used when you only care about the side-effect (in this case, printing) and don't care about the result of the mapped function.
printElements :: [String] -> IO ()
printElements = mapM_ putStrLn