         return nil
     }
     
-    func indexOf(condition: Element -> Bool) -> Int? {
+    /// Return the index of the first array element where the supplied function
+    /// returns true.
+    ///
+    /// :param: condition Function that takes an array element and returns true
+    ///   for a match, otherwise false
+    /// :returns: A zero-based index for the first matching element in the
+    ///   array, otherwise nil
+    func indexOf(condition: TestCallback) -> Int? {
         for (index, element) in enumerate(self) {
             if condition(element) { return index }
         }

extension Array {
    typealias ElementCallback = Element -> Void
    typealias IndexedElementCallback = (Int, Element) -> Void
    typealias TestCallback = (Element) -> Bool
    
    func indexOf<U: Equatable>(item: U) -> Int? {
        if item is Element {
            return find(unsafeBitCast(self, [U].self), item)

        return false
    }
    
    /// Test if all of the array elements pass a given condition.
    ///
    /// :param: test Function that takes an array element and returns true or
    ///   false
    /// :returns: True if every array element passes the test function,
    ///   otherwise false the first time an element fails the test
    func every(test: TestCallback) -> Bool {
        for item in self {
            if !test(item) { return false }
