def detect(hash, what)
      hash.detect do |match, _|
        match.is_a?(Regexp) ? what.match(match) : what.eql?(match)
      end
    end
def detect(hash, what)
      hash.detect do |match, _|
        match.is_a?(Regexp) ? what.match(match) : what.eql?(match)
      end
    end
returns [type, parser]