For example, it should
return "abcde" for ["abc","de"].
ListUtil.hs
concatLists :: [[Char]] -> [Char] concatLists [] = "" concatLists (x:xs) = x ++ (concatLists xs)
*Main> :load ListUtil.hs [1 of 1] Compiling Main ( ListUtil.hs, interpreted ) Ok, modules loaded: Main. *Main> *Main> concatLists ["abc", "de"] "abcde" *Main> concatLists ["abc", "de", "fgh"] "abcdefgh" *Main>
No comments:
Post a Comment