▲ | kristianp 6 days ago | ||||||||||||||||||||||
And on the other end of the spectrum, you have the proponents of Domain-driven design (DDD)[0], where they use an ML descended language such as F# and the aim is to make invalid states unrepresentable by the program [1] [0] https://fsharpforfunandprofit.com/ddd/ [1] Make invalid states unrepresentable: https://geeklaunch.io/blog/make-invalid-states-unrepresentab... | |||||||||||||||||||||||
▲ | zozbot234 6 days ago | parent | next [-] | ||||||||||||||||||||||
How is this "the other end of the spectrum"? The Typestate pattern described at https://geeklaunch.io/blog/make-invalid-states-unrepresentab... (especially wrt. its genericized variety that's quite commonly used in Rust) is precisely a "compile-time hierarchy of encapsulation that matches the domain model", to use Casey Muratori's term for what he's talking about. It's literally inheritance-based OOP in a trenchcoat. | |||||||||||||||||||||||
| |||||||||||||||||||||||
▲ | jbreckmckye 6 days ago | parent | prev [-] | ||||||||||||||||||||||
There is a good book on DDD in F#, Domain Modelling Made Functional | |||||||||||||||||||||||
|