Hacker News new | ask | show | jobs
by grues-dinner 516 days ago
Types imbue pure data with meaning. That's pretty much it, and the other uses of types flow from that.

Whether you use that meaning to produce IDE hints (say, via Python type annotations, though I am aware Python typing isn't only that), or you feed it to a compiler that promises that it will ruthlessly statically enforce the invariants you set via the types, or anything else, is up to you, your goal and the language you use.

1 comments

They also imbue code with meaning, not just data.

For isn't, the return type STM () doesn't give you anything back, but it declares that the method is suitable for transactions (i.e. will change state, but can be rolled back automatically)