Improve consistency with other libraries
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 15/100
- Type d'issue
- Refactorisation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Domaine
- developer-experience
Piste de recherche
Start by reading the discussion in this issue and the linked issues #183, purescript-lists#178, and purescript-arrays#192 to understand the existing API drift. Then compare the List, Array, and Set APIs and the linked article’s arguments about type classes. The issue does not settle on a strategy, so a useful outcome would first require a decision about common interfaces and instance placement.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
There's a lot in common among containers such as List, Array, Set, but their APIs drift out of sync. What's a good strategy to keep everything up to date?
We could continue to apply techniques such as #183 across these libraries, but that requires constant manual intervention.
Would it be appropriate to use more type classes to enforce common interfaces? Or should we avoid those, as suggested in https://harry.garrood.me/blog/down-with-show-part-1/ ? I still don't have a good understanding of how using more typeclasses leads to trouble.
For example we could have a SetLike type class that provides intersection, union, difference, etc. that List, Array, Set would all have an instance of. A similar strategy could have also helped us avoid https://github.com/purescript/purescript-lists/issues/178 and needing to remember to address https://github.com/purescript/purescript-arrays/issues/192. Interfaces could also cut down on the burden of maintaining duplicated documentation for all of these duplicated functions.
Another minor bit of messiness is that we currently have both intersect and intersection, depending on the container. Of course this can be fixed without resorting to typeclasses, but could also have been prevented by embracing more typeclasses.
Also, what determines whether a typeclass instance is defined in the type or the class? It seems somewhat arbitrary. For example:
Semigroupdefines the instances forArrayandVoidVoiddefines the instance forShowShowdefines the instance forArray
Things would be a bit more organized if the policy in core was to always define instances in the type, which would look like the following:
Voiddefines the instance forShowandSemigroupArraydefines instances forShowandSemigroup
- Langage dominant
- PureScript
- Étoiles
- 61
- Forks
- 50
- Merge moyen
- 2 j 6 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de purescript/purescript-lists
-
ZipList is BindOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
purescript/purescript-lists#219 · 1 commentaire · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 48/100
purescript/purescript-lists#218 ·
-
Data.List.NonEmpty.intersect and Data.List.NonEmpty.intersectBy throw when intersection emptyPeut-être pris @evaogbe l’a pris il y a 1066 jours. Ouvertegood first issue type: bug
Difficulté 4/5 3-5 jours Accessibilité débutants 1/100
purescript/purescript-lists#216 · 2 commentaires ·
-
type: enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
purescript/purescript-lists#197 · 1 commentaire ·
-
type: enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 24/100
purescript/purescript-lists#194 · 5 commentaires ·
Toutes les issues de purescript/purescript-lists
Issues similaires
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffixOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
figma/code-connect#419 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
Les mainteneurs répondent en général sous 1 jour
-
trace: Pi's 1-hour cache writes are priced at 1.25x, but billed at 2xPeut-être pris @Shizoqua l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
microsoft/TokenEconomizer#221 ·
Les mainteneurs répondent en général sous 1 jour
-
transformer-directives: `@apply` drops a utility whose CSS is a substring of an earlier one'sPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour