     }
     
     private func updateFilteredData() {
-        if let f = filterFunction {
-            _filteredData.value = value.filter(f)
-        } else {
-            _filteredData.value = value
-        }
+        _filteredData.value = filterFunction.map{value.filter($0)} ?? value
     }
 }
 

public class DiffableArray<T: Equatable> {
    public typealias ChangeHandler = ArrayDiffer<T> -> ()
    
    private var _value: [T]
    private let changeHandler: ChangeHandler
    
    public var value: [T] {
        get { return self._value }
        set {
            changeHandler(ArrayDiffer(oldValue: self._value, newValue: newValue))
            self._value = newValue
        }
    }
    
    public var count: Int {
        return _value.count
    }
    
    public subscript(index: Int) -> T {
        return _value[index]
    }
    
    public init(initialValue: [T] = [], changeHandler: ChangeHandler) {
        self.changeHandler = changeHandler
        _value = initialValue
    }
}


                }
            }
        }
        return a.reverse()
    }
    
    /// @return a mapped list of [x] - [y]
