code: function setPath(path, val, obj) {
    if(!isArray(path) || isEmpty(path)) {
      throw new TypeError(pathErr)
    }
  
    if(!isValid(obj)) {
      throw new TypeError(
        'setPath: Object or Array required for third argument'
      )
    }
  
    const key = path[0]
    let newVal = val
  
    if(!(isString(key) && !isEmpty(key) || isInteger(key) && key >= 0)) {
      throw new TypeError(pathErr)
    }
  
    if(path.length > 1) {
      const next = !isValid(obj[key])
        ? isInteger(path[1]) ? [] : {}
        : obj[key]
  
      newVal = setPath(path.slice(1), val, next)
    }
  
    if(isObject(obj)) {
      if(isString(key)) {
        return object.set(key, newVal, obj)
      }
  
      throw new TypeError(
        'setPath: Non-empty String required in path when referencing an Object'
      )
    }
  
    if(isInteger(key)) {
      return array.set(key, newVal, obj)
    }
  
    throw new TypeError(
      'setPath: Positive Integers required in path when referencing an Array'
    )
  }
docs: setPath :: [ String | Integer ] -> a -> (Object | Array) -> (Object | Array)