3 ms·
> "look how clever I am" essays. Yes. If you had general overload on return type, you could write big nested expressions and force the compiler to examine all
by Animats 6y ago
> "look how clever I am" essays.
Yes. If you had general overload on return type, you could write big nested expressions and force the compiler to examine all the overload possibilities. With enough effort, you could write optimizers for functional programming that way, ones that figured out when you can create a pipeline and avoid storing an intermediate result. Plus combinatoric explosion in compile times. And then you would need more advanced algorithms to find a path through the type maze efficiently. What fun! Good for at least three PhD theses.
Don't go there. Someone will have to maintain that code.