     return ArrayValue(optionalValue) { JSONObjectValue($0) }
 }
 
+
+// MARK: JSONObjectConvertible
 
 public func JSONConvertibleObjectValue <T: JSONObjectConvertible> (optional: AnyObject?) -> T? {
     if let raw: JSONObject = JSONObjectValue(optional) {

public protocol JSONObjectConvertible {
    init(raw: JSONObject) throws
}

public func BoolValue(optionalValue: AnyObject?) -> Bool? {
    if let value: AnyObject = optionalValue {

    }
}

public func NonEmptyString(optionalValue: String?, trimWhitespace: Bool = true) -> String? {
    if let value = optionalValue {
        let trimmedValue: String = (trimWhitespace ? value.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) : value);
        if trimmedValue.isEmpty {
            return nil
        } else {
            return trimmedValue
        }
    } else {
        return nil
    }
}

public func NonEmptyStringValue(optionalValue: AnyObject?, trimWhitespace: Bool = true) -> String? {
    if let value = StringValue(optionalValue) {
        return NonEmptyString(value, trimWhitespace: trimWhitespace)
    } else {
        return nil
    }
}


// MARK: Foundation values


public func URLValue(optionalValue: AnyObject?) -> NSURL? {
    if let string = NonEmptyStringValue(optionalValue) {
        return NSURL(string: string)
    } else {
        return nil
    }
}


// MARK: Collection values

public func ArrayValue<T>(optionalValue: AnyObject?, itemMapper: (AnyObject) -> T?) -> [T]? {
    if let value: AnyObject = optionalValue {
        if let array = value as? [AnyObject] {
