Calculate the length of a Builder without executing it
- Lenguaje dominante
- Haskell
- Estrellas
- 120
- Forks
- 70
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
In the ELF format, there are absolute offsets pointing to positions after the offset.
Thus, calculating this offset requires knowing the length of several Builders, including the length of the Builder that will contain the offset itself.
With the current API and a naive approach that would force the Builders into lazy ByteStrings, you'd end up with <>.
One simple solution, suggested by Joe Hendrix, is to wrap the Builder in a type that contains the Builder and it's length.
data SizedBuilder = SB Int64 Builder
length (SB l _) = l
… + additional methods exported by Data.Binary.Builder
This API could be exposed from Data.Binary.Builder.Sized.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Empieza leyendo Data.Binary.Builder y el módulo propuesto Data.Binary.Builder.Sized. Se considera terminado cuando se expone una API SizedBuilder que incluya la longitud que transporta, incluida su longitud y los métodos adicionales de Builder, sin el bucle recursivo descrito.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- haskell
- Área
- data
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100