Run1 scala functional abstractions
Implementing tokenization logic using functional patterns and standard library collections.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run1_scala-functional-abstractionsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.9 KB, 174 tokens by cl100k_base, as published. Nobody here has run it
Functional Implementation Guidelines
- Traits for Strategy: Define a
Tokenizerbase trait. Instead of complex inheritance hierarchies, prefer composition where possible, or use theSelf-Typeannotation if tight coupling to a configuration is required. - Collection API: Leverage Scala's
IterableandIteratorfor lazy processing. Avoid mutable loops (forwithvar) in favor ofmap,flatMap,filter, andfoldLeft. - Batch Processing: Implement
tokenizeBatchusing parallel collections (.par) orFutureif the data volume requires concurrency, ensuring the code remains compliant with Scala 2.13. - Error Handling: Use
Try[T]orEither[Throwable, T]to wrap potentially failing operations (like numeric parsing) instead of throwing raw exceptions.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.