[go: up one dir, main page]

Skip to content

ThatScalaGuy/ulid4cats

Repository files navigation

ulid4cats

Cats Friendly Badge ulid4cats Scala version support Maven Central

Small cats-effect wrapper around the airframe-ulid library.

Scala3 Sample

Add dependency to yor sbt file

libraryDependencies ++= Seq(
  "org.typelevel"   %% "cats-effect" % "3.5.0", // must be provided
  "de.thatscalaguy" %% "ulid4cats"   % "1.3.0",
)

Application print a new ulid to the console.

import cats.effect.{IO, IOApp, ExitCode}
import de.thatscalaguy.ulid4cats.FULID

object Main extends IOApp:
  def run(args: List[String]): IO[ExitCode] = for {
    id <- FULID[IO].generate
    _  <- IO.println(id)
  } yield ExitCode.Success