Differentiable programming for gradient-based machine learning

Yep, adding an extra protocol is certainly not as ideal.

About typealiases with generic requirements: check out this thread. Seems like the feature could be implemented with a moderate amount of compiler hacking.