code: function func(schema, defaults, options) {
    if (kindOf(schema) !== 'function') {
      if (process.env.NODE_ENV !== 'production') {
        throw new Error(
          `Function structs must be defined as a function, but you passed: ${schema}`
        )
      } else {
        throw new Error(`Invalid schema: ${schema}`)
      }
    }
  
    const name = 'function'
    const type = '<function>'
    const validate = (value = resolveDefaults(defaults), data) => {
      const result = schema(value, data)
      let failure = { path: [], reason: null }
      let isValid
  
      switch (kindOf(result)) {
        case 'boolean': {
          isValid = result
          break
        }
        case 'string': {
          isValid = false
          failure.reason = result
          break
        }
        case 'object': {
          isValid = false
          failure = { ...failure, ...result }
          break
        }
        default: {
          if (process.env.NODE_ENV !== 'production') {
            throw new Error(
              `Validator functions must return a boolean, an error reason string or an error reason object, but you passed: ${schema}`
            )
          } else {
            throw new Error(`Invalid result: ${result}`)
          }
        }
      }
  
      return isValid
        ? [undefined, value]
        : [{ type, value, data: value, ...failure }]
    }
  
    return new Kind(name, type, validate)
  }
docs: Function.
  
  @param {Function} schema
  @param {Any} defaults
  @param {Object} options