Skip to content

Comment on Functional State Machines in Rust: Typestate and Newtype Patternsparent

Comments

Types are puzzles in a good way.

If you were to design Ikea furniture, you'd make pieces that only fit in to the total configuration the correct way.

Types provide that same phenomenon in programming imo. At the end of the day we are shoveling and playing with bytes so we need to provide handles to these processes which make sure that we can't fit a "square peg into a round hole"

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.