First-class support for ADTs
davegurnell opened this issue · 2 comments
davegurnell commented
I have a hunch the definition of Intersection
is over-complicated. I need to review this with @pvillega.
davegurnell commented
After discussion with @pvillega, we reckon this should do it:
- Rename
Struct
toProduct
- Add a first class
SumOfProducts
- Remove
Intersection
(replace it with a Flow/TypescriptIntersection
) - Generate
SumOfProducts
in ccons/cnilEncoder
to make them easier to handle in Elm.
Also, Elm doesn't have literal types or intersections. We should update Renderer
et al so they return an Either
(or Validated
).