Ask HN: How can Higher Kinded Types help in domain driven design?

2 points by truth_seeker ↗ HN

2 comments

[ 2.9 ms ] story [ 15.8 ms ] thread
I don’t mean to be rude, but maybe pick up a book and try to find out yourself?
Higher kinded types create a context arlu d the types(and ultimately the values) they wrap. This can type classes which implement a the same function in different ways for the same value wrapped in a different higher kinded type, for example. So if your domain deals with values in two contexts, and you want to manipulate them using a common language, higher kinded types are a pretty great way to achieve that. They also enable parametric polymorphism, and that creates a LOT of predictable behaviours for free, which in turn allows you to automatically derive typeclasses, interfaces, and theorem proofs in certain situations.