Skip to content

Instantly share code, notes, and snippets.

@piq9117
Created December 5, 2020 00:31
Show Gist options
  • Save piq9117/5bdcb8fa5c20395c34641fbf3f21299e to your computer and use it in GitHub Desktop.
Save piq9117/5bdcb8fa5c20395c34641fbf3f21299e to your computer and use it in GitHub Desktop.
intersperseVec :: a -> Vector a -> Vector a
intersperseVec sep vec = V.cons ( V.head vec )
$ foldr (\v accum -> V.cons sep $ V.cons v accum) V.empty ( V.tail vec )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment