Automated cost analysis of a higher-order language in Coq