Last active
February 3, 2026 20:20
-
-
Save dacr/dc60e4fe02e2b4ef85d68cef934e8b6e to your computer and use it in GitHub Desktop.
ZIO learning - hello world using command line arguments / published by https://github.com/dacr/code-examples-manager #d8733706-94fb-439f-8397-bdef034736ea/d7280711afa2e7f8fe3a0d090d3fa57ce527fb17
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 learning - hello world using command line arguments | |
| // keywords : scala, zio, learning, pure-functional, helloworld | |
| // publish : gist | |
| // authors : David Crosson | |
| // license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) | |
| // id : d8733706-94fb-439f-8397-bdef034736ea | |
| // created-on : 2022-02-27T09:58:19.926769334Z | |
| // managed-by : https://github.com/dacr/code-examples-manager | |
| // run-with : scala-cli $file | |
| // usage-example : scala-cli zio-learning-1-hello-5.sc -- john doe | |
| // --------------------- | |
| //> using scala "3.4.2" | |
| //> using dep "dev.zio::zio:2.0.13" | |
| // --------------------- | |
| // ------------------------------------------------------------------------------ | |
| // Inspired from Example coming from https://zio.dev/docs/getting_started.html | |
| import zio.* | |
| object HelloWorld extends ZIOAppDefault { | |
| val appLogic = for { | |
| args <- getArgs | |
| _ <- Console.printLine(s"Hello, ${args.mkString(" ")}, welcome to ZIO!") | |
| } yield () | |
| def run = appLogic | |
| } | |
| HelloWorld.main(args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment