A component based functional template language