Attempting to sort a 80000 element list gives a stack overflow error.

Abierto
#166 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Área
backend

Línea de trabajo

Start by reading the existing Data.List.sort implementation and compare it with the linked tail-recursive merge sort. Check the list package's sort tests and add coverage for sorting a list of about 80,000 elements. Done means large-list sorting completes without a stack overflow while preserving sort behavior.

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

Descripción

type: enhancement

I am new to PureScript and to learn it, I was implementing a solution to this problem: Project Euler 694. Guess what, when I tried to sort a list (Data.List.sort) of BigInts with about 80000 elements in it, the program crashed with stack out of memory error. So, I worked around it by converting the list to an array, sorting the array and converting the array back to a list.

Also, to wield my new found knowledge of PureScript, I implemented a merge-sort in purescript with a tail-recursive merge function. With this implementation of sort, the program ran successfully without any stack overflow errors. The code for the merge sort is available here: Merge Sort. Could someone replace the implementation of Data.List.sort with the above implementation so that we do not get any stack overflow errors for even modestly large size lists.

Lenguaje dominante
PureScript
Estrellas
61
Forks
50
Merge medio
2 d 6 h
PR fusionados (30 d)
1

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

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 purescript/purescript-lists

Todos los issues de purescript/purescript-lists

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.