haskell / haskell/vector

Adding `intersperse` to the API

未关闭
#421 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
help-wanted
主要语言
Haskell
星标
400
派生
145
PR 合并指标
30 天内没有已合并 PR

描述

I would like to suggest the addition of `intersperse :: a -> Vector a -> Vector a` to the API.

I have a prototype that I reuse in my projects, that reads:

```haskell
intercalateVec :: Text -> Vector Text -> Vector Text
intercalateVec sep vector =
if V.null vector
then vector
else V.tail $ V.concatMap (\word -> V.fromList [sep, word]) vector
```

But I would be interested to know if a better implementation is possible.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。