Skip to content

Miscellaneous

cats-effect

case-app has a module helping using it in cats-effect applications.

Add a dependency to it like

//> using dep com.github.alexarchambault::case-app-cats:2.1.0-M29
(for other build tools, see setup and change case-app to case-app-cats)

Then use it like

import caseapp.catseffect._
import cats.data.NonEmptyList
import cats.effect._

case class ExampleOptions(
  foo: String = "",
  thing: NonEmptyList[String]
)

object IOCaseExample extends IOCaseApp[ExampleOptions] {
  def run(options: ExampleOptions, arg: RemainingArgs): IO[ExitCode] = IO {
    // Core of the app
    // ...
    ExitCode.Success
  }
}