Add note about sorting to documentation (and possibly a transform function)
Nessuno ha ancora preso questa issue.
- Lingua principale
- Haskell
- Stelle
- 401
- Fork
- 145
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
freezeandthawfunctions 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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con il modulo Data.Vector di primo livello e verifica in che modo la relativa documentazione rimanda a vector-algorithms e alle API correlate. Aggiungi una nota che spieghi dove si trovano le funzioni di ordinamento mutable e come freeze/thaw possano supportare i vettori immutabili. Tratta separatamente l’helper di trasformazione immutable proposto, confrontandolo con Data.Vector.Generic.transform e Data.Vector.Generic.Mutable.transform prima di decidere se rientra nell’ambito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- haskell
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100