The application
LiveRoom is all about posting topics and messages. When users sign in, they can start discussions by creating new topics. The newly created topics will be shown in the list of most recent discussions, namely the latest discussions list. If a user clicks on a topic, he/she will enter the discussion and get a list of messages related to the topic. If he/she has signed in, he/she will be able to post a message related to the topic that he/she selected, or comment on an existing message. The following figure shows the data model of topic, message, and comment:
And here are the type definitions in Opa:
type Topic.t = { int id, //id, the primary key string title, //title of the topic string author, //the author int posttime, //post time int lastupdate, //last update time, string lastposter, //last poster int reply, //number of replies stringmap(Message.t) messages } type Message.t = { string author, string content, int posttime, list(Comment...