agentsclimarketplace

Run1 scala functional abstractions

Skill cxcscmu/SkillLearnBench/skills/b3-teacher-feedback-gemini-3.1-flash-lite-preview/python-scala-translation/run1_scala-functional-abstractions

Implementing tokenization logic using functional patterns and standard library collections.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run1_scala-functional-abstractions

Assembled 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 Tokenizer base trait. Instead of complex inheritance hierarchies, prefer composition where possible, or use the Self-Type annotation if tight coupling to a configuration is required.
  • Collection API: Leverage Scala's Iterable and Iterator for lazy processing. Avoid mutable loops (for with var) in favor of map, flatMap, filter, and foldLeft.
  • Batch Processing: Implement tokenizeBatch using parallel collections (.par) or Future if the data volume requires concurrency, ensuring the code remains compliant with Scala 2.13.
  • Error Handling: Use Try[T] or Either[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.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.