 }
 
 extension Dictionary {
-    /// Create an dictionary-decode-closure from key- and value- decode closures
+    /// Create a dictionary decoder from key- and value- decoders
     ///
+    /// This function is used by `=>` and `=>?` overloads when decoding `[K: V]`
+    ///
+    /// - parameter key: A decoder (decode closure) for the `Key` type
+    /// - parameter value: A decoder (decode closure) for the `Value` type
     /// - returns: A closure that takes a `NSDictionary` and "maps" it using key and value decode closures
     public static func decoder(key keyDecodeClosure: (AnyObject) throws -> Key, value elementDecodeClosure: (AnyObject) throws -> Value) -> (AnyObject) throws -> Dictionary {
         return { json in


import Foundation

/// Takes a decode closure and returns one that returns nil if the json object is `NSNull`


extension Optional {
    
    /// Create an array-decode-closure from an element decode closure
    ///
    /// - returns: A closure that takes an `NSArray` and maps it using the element decode closure
    static func decoder(_ decodeClosure: (AnyObject) throws -> Wrapped) -> (AnyObject) throws -> Wrapped? {
        return { json in
            if json is NSNull {


extension Array {
    
    /// Creates an array decoder from an element decoder
    ///
    /// This function is used by `=>` and `=>?` overloads when decoding `[T]`
    ///
    /// - parameter decodeClosure: A decoder (decode closure) for the `Element` type
    /// - throws: if `NSArray.decode` throws or any element decode closure throws
    /// - returns: A closure that takes an `NSArray` and maps it using the element decode closure
    public static func decoder(_ elementDecodeClosure: (AnyObject) throws -> Element) -> (AnyObject) throws -> Array<Element> {
        return { json in
