Closed jdegoes closed 5 years ago
I'll try to work on this one. My main focus in this program is to firstly learn things, if I stall I'll ask for help or notify you that I can't complete this. Thus if there is anyone keen to work on this issue and can complete it - please do.
In order to solve this one, it's necessary to use the full power of Prism, which lets you specify a backup. Then by nesting prisms, you should be able to inductively handle all terms in a sum.
Note this would end up generating something like Schema[Either[Either[Either[[...]]]
, which would then have to be imap
'd to the sum type.
This issue became irrelevant (at least in its current formulation) since we removed optics from the schema GADT.
Sums are encoded as lists of prisms, which means it's possible to fail to get any branch in a sum. That is, you can always set a given branch, but you can fail to retrieve any branch at all, if the user didn't specify enough branches to fully represent the sum type.
I think there's a way to fix this using compositional prisms.