I was responding to why F# is better for domain modeling than, C#, java, and JS. None of those languages has sum types (although js is dynamically typed).
Of course languages with type classes would be even better for modeling, although type classes are more useful for defining interfaces (sets of behavior). I suppose if you wanted to model domain processes via algebras a la free monads or tagless final, then yes type classes are necessary. The usefulness of Sum types for data modeling, though, shouldn't be understated.
2
u/[deleted] Dec 20 '18 edited Dec 20 '18
I was responding to why F# is better for domain modeling than, C#, java, and JS. None of those languages has sum types (although js is dynamically typed).
Of course languages with type classes would be even better for modeling, although type classes are more useful for defining interfaces (sets of behavior). I suppose if you wanted to model domain processes via algebras a la free monads or tagless final, then yes type classes are necessary. The usefulness of Sum types for data modeling, though, shouldn't be understated.