Hacker News new | past | comments | ask | show | jobs | submit
> Awesome, how do you ensure clients of your code always do the correct operations on your data?

Either the data type is opaque (as in you shouldn’t mess with it and you should use the provided api) or it’s just normal primitives and thus no restrictions.

You don’t usually reach into data structures to modify their properties, especially if it’s for foreign modules.