How can I promote code reuse in a manner similar to mixins/method modifiers/traits in other languages?
I'm working on some code that interfaces to a database schema that models a persistent graph. Before I go into the details of my specific question, I thought it might help to provide some motivation. My schema is around books, people and author roles. A book has many author roles, where each role has a person. However, instead of allowing direct UPDATE queries on book objects, you must create a new book, and make modifications to the new version. Now, back to Haskell land. I am currently working with a few type classes, but importantly I have HasRoles and Entity : class HasRoles a where -- Get