dc10.io.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dc10-io_3 Show documentation
Show all versions of dc10-io_3 Show documentation
Code generation tools for Scala
The newest version!
package dc10.io
import cats.effect.Concurrent
import cats.syntax.all.given
import dc10.{Compiler, File, Renderer}
import fs2.io.file.{Files, Path}
extension [F[_]: Concurrent: Files, C, D, E, V](
res: scala.Either[List[E], List[File[C]]]
)(using C: Compiler[C, D, E])
def file(using R: Renderer[C, E, V]): F[List[Path]] =
C.virtualFile(res)(using R).fold(
es => Concurrent[F].raiseError(new Throwable(es.mkString("\n"))),
l => l.traverse(f => FileWriter[F].writeFile(f))
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy