The algebra of data types