feat(UnionConverter): Support upconvert from string to nullary case
- Vorherrschende Sprache
- F#
- Sterne
- 82
- Forks
- 18
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Support upconversion from a representation of an event starts with `TypeSafeEnumConverter` for a given union (and hence has a `string` value), being able to implicitly upconvert from that if the internal representation adds a non-nullary case (and hence switches to using UnionConverter).
Of course, in general one should have a clear picture of whether something is an enum or a full state with data per case. The point here is to be able to represent data that's specific to a case without that having to stuff it into adjacent optional fields with conditional logic defining when the field should be present etc.
#97 is slightly related, but is going the other direction, and is recovering from a missing converter rather than a natural evolution
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start by locating TypeSafeEnumConverter and UnionConverter and read how their string and union representations are handled. Add coverage for upconverting an existing string representation when a union gains a non-nullary case, and verify that the converter accepts the evolved representation without breaking existing cases.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- fsharp, json
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100