Reputation: 19
I am still a beginer in Haskell and I want to know how can I split the numbers in a list in new lines so each line contains one element of the list.
Upvotes: 1
Views: 1376
Reputation: 15692
If you have a [Char]
, a String, you may use the function lines
that splits it... But I think what you're looking for is this:
as_lines l = unlines $ map show l
unlines :: [String] -> String
concatenates the given Strings, using a newline as the connector. I hope this does what you want.
Upvotes: 5