You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/11/08 14:48:07 UTC

[GitHub] ianpartridge commented on issue #3: Initial Support for swift 4

ianpartridge commented on issue #3: Initial Support for swift 4
URL: https://github.com/apache/incubator-openwhisk-runtime-swift/issues/3#issuecomment-342839494
 
 
   Could we use a `Result` type here?
   
   ```swift
   enum Result<T, E: Swift.Error> {
       case success(T)
       case failure(E)
   }
   
   enum OpenWhiskError: Swift.Error {
       case barf
       // etc
   }
   
   struct Employee: Codable {
       let id: Int
       let name: String
   }
   
   func main(input: Employee, respondWith: (Result<Employee, OpenWhiskError>) -> Void) -> Void {
       respondWith(.success(input))
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services