coding style - Simplifying an ugly function in Haskell -


i have defined function f1

f1 p = foldl (\x y -> x ++ y ++ "\t") "" (map (foldl (++) "") p) 

that take

[["4","0","1"],["5","2","3"]] 

and yield

"401\t523\t" 

but function ugly can get. sure there simpler way implement same function. can give me clue it?

function composition friend. intercalate, data.list

f1 = intercalate "\t" . map concat 

edit: whoops, misread output. want "\t" @ end of of them, not between them. in case, it's closer to

f1 = concat . map ((++ "\t") . concat) 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -