List comprehension blocks don't preserve the order of vars and guards
- Vorherrschende Sprache
- Haskell
- Sterne
- 1.3k
- Forks
- 201
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
**Shared Program**:
https://code.world/blocks#PYNCRqCIpHdD-Jh0PQZKMxw
https://code.world/#PLG3J8mHD49-0P8xn8qIiYA
**Description**
In list comprehension blocks, there's an assumption that guards must appear after all variables are declared. As shown in the first shared program, when you add a guard before another local variable declaration, it puts the guard at the end in the code portion. Also, if you open the mutator afterwards, it switches the order of the inputs so the guards are after the variables.
This assumption doesn't work for shadowed variables in list comprehensions which are perfectly valid. An example of this is the second shared program. Note the difference in the left and right picture based on the positioning of the guard
Beitragsleitfaden
Rechercherichtung
Öffne zuerst die beiden verlinkten gemeinsam genutzten Programme und vergleiche die Blockanordnung mit dem generierten Code. Verfolge den Mutator für den List-Comprehension-Block und seine Behandlung von Variablen und Guards; die Aufgabe gilt als abgeschlossen, wenn ihre ursprüngliche Reihenfolge in den Blöcken, im generierten Code und nach dem erneuten Öffnen des Mutators erhalten bleibt, einschließlich des Beispiels mit der überschatteten Variable.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- haskell
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100