我正在尝试将列表中的元素打印到新行上,但我无法将其工作;
printElements :: [String] -> IO()
printElements (x:xs) = print x (some kind of newline, then loop?) printElements xs
Run Code Online (Sandbox Code Playgroud)
所以这:
["1","2","2","4"]
Run Code Online (Sandbox Code Playgroud)
会给:
1
2
3
4
Run Code Online (Sandbox Code Playgroud) haskell ×1