How to model mixins / multiple interfaces in Haskell?
问题 I came across this question on modeling inheritance in Haskell and it reminded me that I have a little more complicated version of the same problem. I'll adopt the example from there because it's easier than thinking up my own. Suppose your program contains a number of types: data Camera = Camera ... data Light = SpotLight ... | DirectionalLight ... data Object = Monster ... | Player ... | NPC ... Now you want to implement some basic physics, so you want them all to have a position and a