Add Hashable typeclass
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- backend
Línea de trabajo
The issue proposes adding a Hashable typeclass to the prelude and deriving support to the compiler, but names no files or tests. Start by reviewing the existing Eq and Ord typeclasses and the linked purescript-unordered-collections implementation. Done means agreeing on the design and adding the prelude typeclass and compiler deriving support; the thread has had no comment for years, so check whether the proposal is still wanted.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I would like to add a Hashable typeclass to the prelude and deriving support for it to the compiler. It is intended as an approximation of equality for use in hash-based algorithms and data structures, such as hash maps, not cryptographically secure digests or password hashes.
class Eq a <= Hashable a where
hash :: a -> Int
There are two reasons for adding it to the prelude instead of having a standalone library:
- Dependencies: To be useful in general data structures, as many datatypes as possible should be hashable. Ideally, whenever a datatype is
Eq, it should also haveOrdandHashableinstances, if possible. Most packages depend on the prelude already.[citation needed] This should make it easier to convince authors to addHashableinstances, because they do not need to add another dependency, all that is required is one more deriving line below the lines forEqandOrd. - Performance: Usually, the main goal of hashing is to avoid expensive comparisons. One could write a generic hash function in terms of
purescript-generics-rep. This would be fine for many applications, but for hash-based data structures etc., the hash function should really be as fast as possible.
I am more than happy to make an initial pull request (based on https://github.com/fehrenbach/purescript-unordered-collections/blob/master/src/Data/Hashable.purs) and work on deriving support.
What do people think?
- Lenguaje dominante
- PureScript
- Estrellas
- 168
- Forks
- 90
- Merge medio
- 3 d 1 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de purescript/purescript-prelude
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 57/100
purescript/purescript-prelude#317 · 1 reacción ·
-
Int bottom is not safeAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 32/100
purescript/purescript-prelude#312 · 5 comentarios ·
-
add liftCompare & friendsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
purescript/purescript-prelude#310 · 5 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 24/100
purescript/purescript-prelude#308 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
purescript/purescript-prelude#307 · 1 comentario · 1 reacción ·
Todos los issues de purescript/purescript-prelude
Issues similares
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Mend: dependency security vulnerability
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ManageIQ/manageiq-pods#1476 ·
Los mantenedores suelen responder en 1 día
-
mcp: typed tool handlers lose wrapped JSON-RPC errorsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
modelcontextprotocol/go-sdk#1529 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
FinanceFlash/unvibecode#818 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100