I have defined the function f1
f1 p = foldl (\x y -> x ++ y ++ "\t") "" (map (foldl (++) "") p)
that will take
[["4","0","1"],["5","2","3"]]
and yield
"401\t523\t"
but is a function as ugly as it can get. I am sure there is a simpler way to implement the same function. Can anybody give me some clue about it?
Function composition is your friend. So is intercalate, from Data.List
Edit: whoops, misread your output. You want “\t” at the end of all of them, not just between them. In that case, it’s closer to