Improve consistency with other libraries
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Refactoring
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- developer-experience
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- PureScript
- Stelle
- 61
- Fork
- 50
- Merge medio
- 2g 6h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di purescript/purescript-lists
-
ZipList is BindAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
purescript/purescript-lists#219 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
purescript/purescript-lists#218 ·
-
Data.List.NonEmpty.intersect and Data.List.NonEmpty.intersectBy throw when intersection emptyForse già presa @evaogbe l’ha presa 1066 giorni fa. Apertagood first issue type: bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 1/100
purescript/purescript-lists#216 · 2 commenti ·
-
type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
purescript/purescript-lists#197 · 1 commento ·
-
type: enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 24/100
purescript/purescript-lists#194 · 5 commenti ·
Tutte le issue di purescript/purescript-lists
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
I maintainer di solito rispondono entro 1 giorno
-
trace: Pi's 1-hour cache writes are priced at 1.25x, but billed at 2xForse già presa @Shizoqua l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/TokenEconomizer#221 ·
I maintainer di solito rispondono entro 1 giorno
-
transformer-directives: `@apply` drops a utility whose CSS is a substring of an earlier one'sForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
compiler bench: virtual.bench.ts "every id resolved and loaded" throws virtual_wrong_realm on mainApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100