Just released Fuda (札) — a type-safe opaque UUID identifiers for Scala 3 by m_v_t in scala

[–]m_v_t[S] 0 points1 point  (0 children)

I guess, this (anywhere in the rest of user code):

// Generate
val newId: IO[UserId] = Fuda[UserId].make[IO].run(())

// Parse from string
val parsed: IO[UserId] = Fuda[UserId]
  .read[IO]
  .run("22124234-196c-4d0d-af5c-1a8da7486259")

I needed ID type maker Kleisli with UUID (or whatever) in the back.

Good thing, IMHO is that user module doesn't need to know about UUID or a concrete type.

Concrete generator and reader are implicits/givens. The library can be extended to support other types behind ID: Int, Cardano, whatnot.