Template Functional Programming