Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Adding `intersperse` to the API

Open
#421 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell
Domain
api

Research direction

Review the vector package's existing Vector API and the supplied intercalateVec prototype first. Determine the intended behavior of intersperse, including empty and non-empty vectors, and compare possible implementations before proposing the API addition. Completion should include an agreed implementation and validation of its behavior.

Written by the indexing model from the issue text.

Description

help-wanted

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:

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.

Dominant language
Haskell
Stars
401
Forks
145
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/vector

All issues in haskell/vector

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.