define cons both as operation and as type