title: Pattern matching a regex pattern in Haskell
body: <p>In Scala, I have a regular expression pattern match like this:</p>
  
  <pre><code>val Regex = """(\d{4})/(\d{2})/(\d{2})""".r
  val Regex(year, month, day) = "2013/01/06"
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>year: String = 2013
  month: String = 01
  day: String = 06
  </code></pre>
  
  <p>How can I accomplish a similar result in Haskell? In other words, can I match a regular expression containing groups and assign the groups to identifiers?</p>