 /// - parameter f:     The function/method to weakly apply owner to as the first argument
 ///
 /// - returns: A function where owner is weakly applied to the given function f. If owner is nil, returns nil. If owner is not nil, returns `f(owner)($0)`
-public func weakify <T: AnyObject, U, V>(owner: T, _ f: T->U->V) -> U -> V? {
+public func weakify <T: AnyObject, U, V>(owner: T, _ f: (T) -> (U) -> V) -> (U) -> V? {
     return { [weak owner] obj in
         if let this = owner {
             return f(this)(obj)

/// - parameter f:     The function/method to weakly apply owner to as the first argument
///
/// - returns: A function where owner is weakly applied to the given function f. If owner is nil, nothing happens. If owner is not nil, returns `f(owner)($0 as? U)`
public func weakify <T: AnyObject, U, V>(owner: T, _ f: T -> U? -> ()) -> V -> () {
    return { [weak owner] obj in
        if let this = owner {
            f(this)(obj as? U)

/// - parameter f:     The function/method to weakly apply owner to as the first argument
///
/// - returns: A function where owner is weakly applied to the given function f. If owner is nil, nothing happens. If owner is not nil, calls `try f(owner)()`
public func weakify <T: AnyObject, U>(owner: T, _ f: (T) -> () throws -> Void) -> U throws -> Void {
    return { [weak owner] _ in
        if let this = owner {
            try f(this)()
