con-kitty / categorifier-c

Haskell to C compiler via Categorifier
BSD 3-Clause "New" or "Revised" License
29 stars 3 forks source link

Generate product types to contain fallback values for unions #54

Open zliu41 opened 2 years ago

zliu41 commented 2 years ago

Supplying an additional input value to use in the case that the value to be converted from arrays is a non-finite floating-point value gets tricky with unions; we must have a product type that contains a constructor corresponding to each constructor available in the union, because we don't know which constructor we will be in at runtime.

ACs:

(Extricated from https://kitty-hawk.atlassian.net/browse/SW-5707)

zliu41 commented 2 years ago

Greg Pfeil January 7, 2022, 3:48 PM

Peddie’s parting words on this are that it’s not currently necessary, but would be if we ever have a sum type that has floating point values on more than one alternative.