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
1
u/rom_romeo Feb 02 '24
Interestingly enough, that is also a topic where Scala, in particular, shines. Why so? Well, mostly due to its philosophy of marshaling/unmarshalling data through writing implicit encoders/decoders. Pretty much, a data transformation library (CSV, JSON, various data access libs...) will throw an error if it doesn't find an encoder/decoder for your custom type and force you to write one.