deleteWith function & friends
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Bereich
- backend
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- PureScript
- Sterne
- 58
- Forks
- 70
- Ø Merge
- 2 T. 22 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-arrays
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 55/100
purescript/purescript-arrays#246 ·
-
generate functionOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
purescript/purescript-arrays#244 · 2 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
purescript/purescript-arrays#241 ·
-
`groupBy` has unexpected `l` argument for `a -> a -> Boolean` predicateEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 25/100
purescript/purescript-arrays#229 · 3 Kommentare ·
-
type: enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
purescript/purescript-arrays#215 · 3 Kommentare ·
Alle Issues in purescript/purescript-arrays
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Mend: dependency security vulnerability
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Mend: dependency security vulnerability
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ManageIQ/manageiq-pods#1476 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
prime-radiant-inc/evener#6366 ·
Maintainer antworten meist innerhalb von 1 Tag