Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#232 5 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
haskell

Línea de trabajo

Comienza con el módulo Data.Vector de nivel superior y revisa cómo su documentación enlaza con vector-algorithms y APIs relacionadas. Añade una nota que explique dónde se encuentran las funciones de ordenación mutable y cómo freeze/thaw pueden servir de apoyo para vectores inmutables. Trata por separado el helper de transformación inmutable propuesto, comparándolo con Data.Vector.Generic.transform y Data.Vector.Generic.Mutable.transform antes de decidir si entra en el alcance.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Haskell
Estrellas
401
Forks
145
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de haskell/vector

Todos los issues de haskell/vector

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.