First-order functional languages and intensional logic