Last active
May 25, 2024 10:20
-
-
Save dacr/cdc56b146782d2ff9ab34e15ec0c58e9 to your computer and use it in GitHub Desktop.
ZIO live session - Hello world / published by https://github.com/dacr/code-examples-manager #7d6e7858-f20b-43da-a914-50027a61af79/94dc1bf0459b8d77b0f0cb35d7cd2202e770b412
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// summary : ZIO live session - Hello world | |
// keywords : scala, zio, live, demo, pure-functional, @testable | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 7d6e7858-f20b-43da-a914-50027a61af79 | |
// created-on : 2021-09-26T16:27:18+02:00 | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : scala-cli $file | |
// --------------------- | |
//> using scala "3.4.2" | |
//> using dep "dev.zio::zio:2.0.13" | |
//> using dep "fr.janalyse::zio-worksheet:2.0.13.0" | |
// --------------------- | |
import zio.*, zio.worksheet.* | |
println("Hello world !") | |
// --------------------------- | |
val logic1 = ZIO.attempt(println("Hello world!")) | |
logic1.unsafeRun | |
// --------------------------- | |
val logic2 = Console.printLine("Hello world!") | |
logic2.unsafeRun |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment