deleteWith function & friends
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- backend
Direzione di ricerca
The issue provides a deleteWith example and links to purescript/purescript-arrays#167; no source files or tests are named. Read that linked issue and the array library’s existing findIndex and delete functions to understand the available APIs. Done means deciding which “with” functions belong in the library and implementing and testing the agreed set.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A lot of functions like delete require an index. A lot of times that index was not stored (which would also get updated as the array would change) but has to be refound with findIndex. When you use findIndex and immediately after use delete you know you are guaranteed an index that is not out of bounds. Could "with" functions be added that do this?
deleteWith :: forall a. (a -> Boolean) -> Array a -> Maybe (Array a)
deleteWith pred array = map (\idx -> unsafeDeleteAt idx array) (findIndex pred array)
It would make sense to have the unsafe implementations for them available, at least internally in the array library https://github.com/purescript/purescript-arrays/issues/167
One could argue that if you do this you are better off using a Map. But i think people will want to use an array plenty of times anyway.
- Lingua principale
- PureScript
- Stelle
- 58
- Fork
- 70
- Merge medio
- 2g 22h
- 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-arrays
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
purescript/purescript-arrays#246 ·
-
generate functionAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
purescript/purescript-arrays#244 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
purescript/purescript-arrays#241 ·
-
`groupBy` has unexpected `l` argument for `a -> a -> Boolean` predicateForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
purescript/purescript-arrays#229 · 3 commenti ·
-
type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
purescript/purescript-arrays#215 · 3 commenti ·
Tutte le issue di purescript/purescript-arrays
Issue simili
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ManageIQ/manageiq-pods#1476 ·
I maintainer di solito rispondono entro 1 giorno
-
mcp: typed tool handlers lose wrapped JSON-RPC errorsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
modelcontextprotocol/go-sdk#1529 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
FinanceFlash/unvibecode#818 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100