Seol mar théacs é seo: A Functional Implementation of the Formal Template Language