用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill scala-pattern-matching-dispatch命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | scala-pattern-matching-dispatch |
| description | Type-safe dispatch using Scala pattern matching for polymorphic operations |
Scala's pattern matching provides superior type-safe dispatch compared to Python's isinstance checks and duck typing.
def tokenize(value: Any): Token = value match {
case s: String => tokenizeString(s)
case i: Int => tokenizeInt(i)
case d: Double => tokenizeDouble(d)
case l: LocalDateTime => tokenizeDateTime(l)
case null => Token("NULL", NULL)
case _ => Token(value.toString, STRING, Map("fallback" -> true))
}
ifvalue match {
case s: String if s.nonEmpty => processString(s)
case s: String => Token("EMPTY", STRING)
case _ => fallback(value)
}
value match {
case null => handleNull()
case true => handleTrue()
case 0 => handleZero()
case _ => handleOther()
}
values match {
case Seq() => "empty"
case Seq(single) => s"one: $single"
case Seq(first, rest @ _*) => s"first=$first, count=${rest.length}"
case _ => "unknown"
}
tokenType match {
case STRING => "string type"
case NUMERIC => "numeric type"
case TEMPORAL => "temporal type"
case STRUCTURED => "structured type"
case BINARY => "binary type"
case NULL => "null type"
}
When matching on sealed traits, the compiler enforces exhaustiveness.