【发布时间】:2012-03-02 12:30:36
【问题描述】:
有没有用分隔符连接列表元素的功能? 例如:
> foobar " " ["is","there","such","a","function","?"]
["is there such a function ?"]
感谢您的回复!
【问题讨论】:
-
我知道 lmgtfy 的答案很糟糕,但值得注意的是,在 hoogle 上搜索“String -> [String] -> String”会得到你想要的。 haskell.org/hoogle
-
加入空间你也有
unwords -
@sigfpe 旁注:你必须寻找
[String] -> String -> String,以防其他方式返回没有答案,对吧? -
@LayGonzález 搜索取决于排列。例如,搜索
[a] -> (a -> b) -> [b]会返回map作为其第一个结果。