Deriving and using destructive data types