From Mathematics to Generic Programming