AGENT SKILL

python-scala-functional-idioms

Guidelines for translating Python functional patterns and simulations to idiomatic Scala.

License 许可
MIT
最近更新
2026-10-02
Stars
★ 93
Forks
8

01 前言 Front Matter

name
python-scala-functional-idioms
description
Guidelines for translating Python functional patterns and simulations to idiomatic Scala.

03 SKILL.md 正文

Python to Scala Functional Idioms

Functions and Callables

  • Python Callable[[T], R] -> Scala T => R.
  • Python Optional[T] -> Scala Option[T].

Overloading and Dispatch

  • Python @overload -> Scala method overloading.
  • Python isinstance dispatch -> Scala pattern matching.

Functors and Monads

  • Python simulated Functor/Monad -> Scala's built-in map/flatMap patterns.
  • Proper Scala implementation should follow the def map[B](f: A => B): F[B] signature.

Builder Pattern

  • Python fluent builder -> Scala class with methods returning this.type or new instances for immutability.

04 同仓库更多 Skills