function parseRule (rule, rules) {
  if (typeof rule === 'function') {
    return [rule, []]
  }
  if (Array.isArray(rule) && rule.length) {
    rule = rule.map(r => r) // light clone
    const [ruleName, modifier] = parseModifier(rule.shift())
    if (typeof ruleName === 'string' && rules.hasOwnProperty(ruleName)) {
      return [rules[ruleName], rule, ruleName, modifier]
    }
    if (typeof ruleName === 'function') {
      return [ruleName, rule, ruleName, modifier]
    }
  }
  if (typeof rule === 'string' && rule) {
    const segments = rule.split(':')
    const [ruleName, modifier] = parseModifier(segments.shift())
    if (rules.hasOwnProperty(ruleName)) {
      return [rules[ruleName], segments.length ? segments.join(':').split(',') : [], ruleName, modifier]
    } else {
      throw new Error(`Unknown validation rule ${rule}`)
    }
  }
  return false
}
Given a string or function, parse it and return an array in the format
[fn, [...arguments]]
@param {string|function} rule