title: idiomatic scala/FP way of expressing similar value objects
body: <p>I am wondering what is the idiomatic way to express similar messages (value objects) 
  Let's say I have some messages that I want to send : UserEnter, UserLeft, UserSendGreeting etc'. I hope that the following can express my dilemma</p>
  
  <p>there are two options that I think one can express it :</p>
  
  <pre><code>trait UserAction
  case class UserEnter (username:String,hour:Long,day:WeekDay,room:Int)
  case class UserLeft (username:String,hour:Long,day:WeekDay,room:Int)
  case class UserSendGreeting (username:String,,hour:Long,day:WeekDay,greeting:String)
  
  def foo(userActions:List[UserAction]) = {
  userActions match {
  case UserEnter(userName)::tail =&gt;
  sendWelcomeMessage(userName)
  handleOtherActions(tail) 
  
  case UserLeft::tail =&gt; "must enter first"
  case _ =&gt; "do something else"
  }
  </code></pre>
  
  <p>another way is :</p>
  
  <pre><code>    trait Action
      case class Enter(room:Int) extends Action
      case object Left(room:Int) extends Action
      case object Greet(msg:String) extends Action
  
      case class UserAction(username:String,action:Action,,hour:Long,day:WeekDay)
  
      def foo(userActions:List[UserAction]) = {
      userActions match {
      case head::tail if head.action == Enter =&gt;
      sendWelcomeMessage(head.userName)    
      handleOtherActions(tail)             
      case head::tail if head.action == Left =&gt; "must enter first"
      case _ =&gt; "do something else"
      }
  </code></pre>
  
  <p>The 1st option is more explicit and easier to pattern match but more repetitive code. 
  The other one is more explicit on the action itself but pattern match is more verbose<br>
  which way is better ?</p>