jet / jet/FsCodec

feat(UnionConverter): Support upconvert from string to nullary case

Aperta
#116 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
F#
Stelle
82
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.