|
|
|
|
|
by lmm
2968 days ago
|
|
You shouldn't need special cases for optional/maybe in the first case; optional/maybe are simple sum types, you would want whatever flow-typing system you have to do the right thing with user-defined "x or y or z" types, and if you do that then it'll automatically work just as well for optional/maybe. (I don't like inclusive union types because they're noncompositional - code you write with them isn't parametric any more - which seems particularly awkward in a compiled language - how do you compile code that forms unions involving type parameters?) |
|
I'm not 100% sure how you can integrate sum types with a flow-typing system, perhaps with pattern matching?