         if let wrapped = self { f(wrapped) }
     }
 
+    @warn_unused_result
     func onSome(@noescape f: Wrapped -> Void) -> Optional {
 
         then(f)
         return self
     }
 
+    @warn_unused_result
     func onNone(@noescape f: Void -> Void) -> Optional {
 
         if isNone { f() }

        return self != nil
    }

    var isNone: Bool {

        return !isSome
    }


public extension Optional {

    @warn_unused_result
    func filter(@noescape predicate: Wrapped -> Bool) -> Optional {

        return map(predicate) == .Some(true) ? self : .None
    }

    @warn_unused_result
    func replaceNil(with replacement: Wrapped) -> Optional {

        return self ?? replacement
