Safe modelling of relational data in Haskell
问题 I find it very common to want to model relational data in my functional programs. For example, when developing a web-site I may want to have the following data structure to store info about my users: data User = User { name :: String , birthDate :: Date } Next, I want to store data about the messages users post on my site: data Message = Message { user :: User , timestamp :: Date , content :: String } There are multiple problems associated with this data structure: We don't have any way of