             if let index = key as? Int {
                 return getIn(array[index], keyPath: Array(dropFirst(keyPath)))
             } else {
-                return nil
+                return .None
             }
         case let .Map(map, tag):
             if let name = key as? String {
-                return getIn(map[name]!, keyPath: Array(dropFirst(keyPath))) ?? nil
+                return getIn(map[name]!, keyPath: Array(dropFirst(keyPath))) ?? .None
             } else {
-                return nil
+                return .None
             }
         default:
-            return nil
-        }
-    }
-    
-    public static func setIn(state: State, forKeyPath: [Any], withValue: Any) -> State? {
-            }
+            return .None
+        }
+    }
+    
+    // Set or create the given value at the given keypath. Returns the modified state.
+    public static func setIn(state: State, forKeyPath: [Any], withValue: State?) -> State {
+        return mutateIn(state, atKeyPath: forKeyPath, mutator: {(state) in
+            return withValue ?? State.None
+        })
+    }
     
     
     // Recurse down to the key at the given path (creating the path if necessary), and

        return [:]
    }
    
    public static func getIn(state: State, keyPath: [Any]) -> State? {
        if keyPath.count == 0 {
            return state
        }

    func getIn(keyPath: [Any]) -> Immutable.State? {
        return Immutable.getIn(self, keyPath: keyPath)
    }
    
    func setIn(keyPath: [Any], withValue: Immutable.State?) -> Immutable.State {
        return Immutable.setIn(self, forKeyPath: keyPath, withValue: withValue)
    }
}

func ===(a: Immutable.State, b: Immutable.State) -> Bool {
