AGENT SKILL

run2_scala-data-abstractions

Idiomatic data modeling with case classes, sealed traits, and exhaustive matching.

适用职业数据分析师
License 许可
MIT
最近更新
2026-10-02
Stars
★ 93
Forks
8

01 前言 Front Matter

name
run2_scala-data-abstractions
description
Idiomatic data modeling with case classes, sealed traits, and exhaustive matching.

03 SKILL.md 正文

Best Practices

  1. Sealed Hierarchy: Ensure all subtypes are known at compile time for exhaustive pattern matching.

    sealed trait TokenValue
    case class StringValue(s: String) extends TokenValue
    
  2. Case Classes: Use for data containers. They provide equals, hashCode, copy, and constructor-based pattern matching out of the box.

  3. Collections: Prefer immutable.Seq, Vector, or List for functional transformations. Use view for lazy operations.

04 同仓库更多 Skills