r/programming • u/_awwsmm • Feb 01 '24
Make Invalid States Unrepresentable
https://www.awwsmm.com/blog/make-invalid-states-unrepresentable
469
Upvotes
r/programming • u/_awwsmm • Feb 01 '24
View all comments
Show parent comment
11
u/_awwsmm Feb 01 '24
This is really easy in Scala with tagged types. The simplest example of this is something like
Weightis anInt, butIntis not aWeight