 import Foundation
-
 
 enum QCError: ErrorType {
   case PasswordNotFound


func connect(password: String?, network: String?) -> Result<NSAppleEventDescriptor, QCError> {
  return
    (validatePassword(password) &&& validateNetwork(network))
    .flatMap(createScript)
    .flatMap(executeScript)
}



func updatePassword(password: String?) -> Result<String, QCError> {
  return
    validatePassword(password)
    >>- storePassword
    >>- {_ in .Success("Password updated! 🍻") }
}

func validatePassword(password: String?) -> Result<String, QCError> {
