extension Optional { func flatten<T>() -> T? where Wrapped == T? { return flatMap { $0 } } }
extension<T> Optional where Wrapped == T? { func flatten() -> T? { return flatMap { $0 } } }