Functional Programming Deep Learning