davegurnell/bridges

First-class support for ADTs

davegurnell opened this issue · 2 comments

I have a hunch the definition of Intersection is over-complicated. I need to review this with @pvillega.

After discussion with @pvillega, we reckon this should do it:

  • Rename Struct to Product
  • Add a first class SumOfProducts
  • Remove Intersection (replace it with a Flow/Typescript Intersection)
  • 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).

Fixed by PR #18 (not sure why it didn't close this automatically)