Why does lazy list foldr reverse into a temporary lazy list?

Offen
#197 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Bereich
backend

Rechercherichtung

The issue points to src/Data/List/Lazy/Types.purs, around line 121, where foldr uses reverse. Read that implementation and compare its temporary lazy list with the proposed JavaScript array approach. Done means determining whether the array approach is suitable and, if so, changing the implementation while preserving foldr behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

type: enhancement

I get why https://github.com/purescript/purescript-lists/blob/v6.0.0/src/Data/List/Lazy/Types.purs#L121 does what it does with reverse, but it seems to me there is no reason to create a brand new temporary lazy list just to consume it left to right. How about pushing elements left to right into a temporary JavaScript array and then going right to left in that?

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

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus purescript/purescript-lists

Alle Issues in purescript/purescript-lists

Ähnliche Issues

Weitere Issues zu Backend & API Design

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.