3 ms·
As long as you're not doing type casting or any funny reflection, you can write that code and it'll be caught at compile-time. I wrote a library [1] that does
by jiaweihli 10y ago
As long as you're not doing type casting or any funny reflection, you can write that code and it'll be caught at compile-time.
I wrote a library [1] that does this in a readable pattern-matching way, hope you find it useful!
[1] https://github.com/jiaweihli/rematch https://github.com/jiaweihli/rematch