Theory of Functional Programming