demonstrate file writing

This commit is contained in:
Mark Canlas 2022-12-04 13:01:22 -05:00
parent d9fedd52dd
commit f3feb1ac06
2 changed files with 9 additions and 4 deletions

View File

@ -19,7 +19,7 @@ lazy val scratchpad =
lazy val demo = lazy val demo =
module("demo") module("demo")
.withEfectMonad .withEfectMonad
.settings(libraryDependencies += "com.htmlism" %% "rufio-zio" % "71-5394aaef") .settings(libraryDependencies += "com.htmlism" %% "rufio-zio" % "74-5cd25e9b")
ThisBuild / resolvers += "mcanlas/rufio" at "https://maven.pkg.github.com/mcanlas/rufio/" ThisBuild / resolvers += "mcanlas/rufio" at "https://maven.pkg.github.com/mcanlas/rufio/"

View File

@ -8,6 +8,11 @@ import com.htmlism.rufio.withzio._
object PrintPrograms extends ZIOAppDefault: object PrintPrograms extends ZIOAppDefault:
def run: ZIO[Any, Throwable, Unit] = def run: ZIO[Any, Throwable, Unit] =
File("data/example.txt") for {
.contents _ <- File("data/out.txt")
.map(println) .writeLine("out")
_ <- File("data/example.txt")
.contents
.map(Console.printLine(_))
} yield ()