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

Add note about sorting to documentation (and possibly a transform function)

Open
#232 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell
Domain
documentation

Research direction

Start with the top-level Data.Vector module and review how its documentation links to vector-algorithms and related APIs. Add a note explaining where mutable sorting functions live and how freeze/thaw can support immutable vectors. Treat the proposed immutable transform helper separately, comparing it with Data.Vector.Generic.transform and Data.Vector.Generic.Mutable.transform before deciding whether it belongs in scope.

Written by the indexing model from the issue text.

Description

Continuing from #157 - sorting algorithms are available in vector-algorithm, but it isn't easy to find that information out, depending on how you search. For example, the Stackage Hoogle query for sort :: Ord a => Vector a -> Vector a doesn't come up with the result (because that package doesn't provide a wrapper for immutable vectors).

It would be nice if a note about this could be added to the top-level module Data.Vector, which serves as the "information hub" right now. Something along the lines of:

Note: Sorting algorithms for mutable vectors are available in the vector-algorithms package. If you want to sort an immutable vector, you can use the freeze and thaw functions to wrap calls to sorting functions of your choice.

Personally, I think it would be nice to have a helper function alongside

Data.Vector.Generic.transform 
  :: (PrimMonad m, Vector v a) 
  => (Mutable v (PrimState m) a -> m (Mutable v (PrimState m) a)) 
  -> v a
  -> m (v a)
transform f = unsafeFreeze <=< f <=< thaw

as an counterpart to Data.Vector.Generic.Mutable.transform (the signatures aren't exactly analogous though because of the extra m 🙁), but of course, it isn't strictly necessary, just a nice to have thing.

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.