Improve consistency with other libraries
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 15/100
- Issue-Typ
- Refactoring
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Bereich
- developer-experience
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- PureScript
- Sterne
- 61
- Forks
- 50
- Ø Merge
- 2 T. 6 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus purescript/purescript-lists
-
ZipList is BindOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
purescript/purescript-lists#219 · 1 Kommentar · 1 Reaktion ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 48/100
purescript/purescript-lists#218 ·
-
Data.List.NonEmpty.intersect and Data.List.NonEmpty.intersectBy throw when intersection emptyEvtl. vergeben @evaogbe hat das vor 1066 Tagen übernommen. Offengood first issue type: bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 1/100
purescript/purescript-lists#216 · 2 Kommentare ·
-
type: enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
purescript/purescript-lists#197 · 1 Kommentar ·
-
type: enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 24/100
purescript/purescript-lists#194 · 5 Kommentare ·
Alle Issues in purescript/purescript-lists
Ähnliche Issues
-
1.3 bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffixOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
figma/code-connect#419 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
nicobailon/pi-subagents#3276 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag