functional types example