In Scala, I have a regular expression pattern match like this:
val Regex = """(\d{4})/(\d{2})/(\d{2})""".r
val Regex(year, month, day) = "2013/01/06"
The result is:
year: String = 2013
month: String = 01
day: String = 06
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?