code: function dict(schema, defaults, options) {
    if (kindOf(schema) !== 'array' || schema.length !== 2) {
      if (process.env.NODE_ENV !== 'production') {
        throw new Error(
          `Dict structs must be defined as an array with two elements, but you passed: ${schema}`
        )
      } else {
        throw new Error(`Invalid schema: ${schema}`)
      }
    }
  
    const obj = scalar('object', undefined, options)
    const keys = any(schema[0], undefined, options)
    const values = any(schema[1], undefined, options)
    const name = 'dict'
    const type = `dict<${keys.type},${values.type}>`
    const validate = value => {
      const resolved = resolveDefaults(defaults)
      value = resolved ? { ...resolved, ...value } : value
      const [error] = obj.validate(value)
  
      if (error) {
        error.type = type
        return [error]
      }
  
      const ret = {}
      const errors = []
  
      for (let k in value) {
        const v = value[k]
        const [e, r] = keys.validate(k)
  
        if (e) {
          const allE = e.errors || [e]
          allE.forEach(singleE => {
            singleE.path = [k].concat(singleE.path)
            singleE.data = value
            errors.push(singleE)
          })
          continue
        }
  
        k = r
        const [e2, r2] = values.validate(v)
  
        if (e2) {
          const allE2 = e2.errors || [e2]
          allE2.forEach(singleE => {
            singleE.path = [k].concat(singleE.path)
            singleE.data = value
            errors.push(singleE)
          })
          continue
        }
  
        ret[k] = r2
      }
  
      if (errors.length) {
        const first = errors[0]
        first.errors = errors
        return [first]
      }
  
      return [undefined, ret]
    }
  
    return new Kind(name, type, validate)
  }
docs: Dict.
  
  @param {Array} schema
  @param {Object} defaults
  @param {Object} options