Skip to content

Instantly share code, notes, and snippets.

@nikuuchi
Created May 15, 2014 15:55
Show Gist options
  • Select an option

  • Save nikuuchi/31ef8fe6cef39773d48c to your computer and use it in GitHub Desktop.

Select an option

Save nikuuchi/31ef8fe6cef39773d48c to your computer and use it in GitHub Desktop.
文字列の配列をカンマでつなげる
join :: [String] -> String
join [] = ""
join (x:[]) = x
join (x:xs) = x ++ ", " ++ join xs
main = do
print $ join ["hoge", "fuga", "piyo"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment