haskell / haskell/vector

Adding `intersperse` to the API

Aperta
#421 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
help-wanted
Lingua principale
Haskell
Stelle
400
Fork
145
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.