A type and effect system for uniqueness and immutability