Skip to content

Instantly share code, notes, and snippets.

View ghostdogpr's full-sized avatar

Pierre Ricadat ghostdogpr

View GitHub Profile
import scala.io.{ Codec, Source }
import zio.{ App, console, ZIO }
import zio.blocking._
object SampleApp extends App {
def getResource(path: String): ZIO[Blocking, Throwable, String] = effectBlocking {
Source.fromResource(path)(Codec.UTF8).getLines.mkString
}
import java.nio.file.{ Files, Paths }
import zio.IO
def copyFile(path: String, destination: String): IO[Throwable, Unit] = IO.effect {
Files.copy(Paths.get(path), Paths.get(destination))
}