         return resolve((), type: type, name: name, cached: cached)
     }
     
+    /**
+     Unregisters the dependency with the given key.
+     
+     - returns: Whether or not the key was present and could be unregistered.
+    */
+    public static func unregister(key: Any) -> Bool {
+        if let key = key as? Key {
+            return dependencies.removeValueForKey(key) != nil
+        }
+        return false
+    }
+
+    /**
+     Unregisters the dependency with the given type and name.
+     
+     - parameter type: The type of the dependency to unregister.
+     - parameter name: The name of the dependency to unregister (optional).
+     
+     - returns: Whether or not the key was present and could be unregistered.
+    */
+    public static func unregister(type type: String, name: String? = nil) -> Bool {
+        let key = Key(type: type, name: name)
+        return unregister(key)
+    }
+    
+    /**
+     Unregisters the dependency with the given name and type, as determined by the block.
+     
+     - parameter name: The optional name under which the dependency was registered.
+     - parameter create: A block (not called) used to determine the type that was registered.
+     
+     - returns: Whether or not the key was present and could be unregistered.
+     
+     - note: The block is never called. It is only used to determine the type used to
+     originally register the block.
+    */
+    public static func unregister<D>(name: String? = nil, create: () -> D) -> Bool {
+        return unregister(type: String(reflecting: D.self), name: name)
+    }
+    
+    /**
+     Clears all dependencies from Guise.
+    */
+    public static func reset() {
+        dependencies = [:]
+    }
 }
 
 private func ==(lhs: Guise.Key, rhs: Guise.Key) -> Bool {

*/

import Foundation

/**
 A simple, elegant, flexible dependency resolver.

    public static func resolve<P, D>(parameters: P, type: String = String(reflecting: D.self), name: String? = nil, cached: Bool = true) -> D? {
        let key = Key(type: type, name: name)
        guard let dependency = dependencies[key] else { return nil }
        defer {
            if dependency.lifecycle == .OneTime {
                unregister(key)
            }
        }
        return (dependency.resolve(parameters, cached: cached) as D)
    }
    
