title: Swift pattern matching with enum and Optional tuple associated values
body: <p>I'm currently using Alamofire and I use an enum to describe the API I used as advised in the readme.</p>
  
  <p>The endpoints are represented as follows:</p>
  
  <pre><code>public enum API {
      case GetStops(stopCode:String?)
      case GetPhysicalStops
      case GetLinesColors
      case GetNextDepartures(stopCode:String, departureCode:String?, linesCode:String?, destinationsCode:String?)
  }
  </code></pre>
  
  <p>The optional parameters are mutually exclusive:</p>
  
  <pre><code> public var URLRequest: NSMutableURLRequest {
  
          let result:(path:String, parameters:[String:AnyObject]?) = {
              switch self {
              case .GetStops(let stopCode) where stopCode != nil :
                  return ("GetStops.json", ["stopCode" : stopCode!])
              case .GetStops(_):
                  return ("GetStops.json", nil)
              case .GetPhysicalStops:
                   return ("GetPhysicalStops.json", nil)
              case .GetLinesColors:
                  return ("GetLinesColors",nil)
              case .GetNextDepartures(let stopCode, let departureCode, _, _) where departureCode != nil:
                  return ("GetNextDepartures", ["stopCode" : stopCode, "departureCode": departureCode!])
              case .GetNextDepartures(let stopCode, _, let linesCode, _) where linesCode != nil:
                  return ("GetNextDepartures", ["stopCode" : stopCode, "linesCode": linesCode!])
              case .GetNextDepartures(let stopCode, _, _, let destinationsCode) where destinationsCode != nil:
                  return ("GetNextDepartures", ["stopCode" : stopCode, "destinationsCode": destinationsCode!])
              case .GetNextDepartures(let stopCode,_,_,_):
                  return ("GetNextDepartures",["stopCode":stopCode])
              }
              }()
  </code></pre>
  
  <p>Is there a way to unwrap automatically the optional contained (like <code>if let</code>) within the tuple and avoiding to explicity unwrap like in this statement :</p>
  
  <pre><code>case .GetStops(let stopCode) where stopCode != nil :
                      return ("GetStops.json", ["stopCode" : stopCode!])
  </code></pre>