Core concept

// package foo/utils.scala
package foo
def greet(n: String) = s"Hi $n"
Advertisement

How it works

Only Scala 3. Migration from Scala 2 object-wrapped.

Advertisement

Trade-offs + gotchas

Utility functions. Package-level helpers.